diff --git a/GSWAdaptors/Apache/mod_gsweb.c b/GSWAdaptors/Apache/mod_gsweb.c index 353273f..bc8f06d 100644 --- a/GSWAdaptors/Apache/mod_gsweb.c +++ b/GSWAdaptors/Apache/mod_gsweb.c @@ -654,10 +654,18 @@ GSWeb_Handler(request_rec *p_pRequestRec) else { CONST char *pszDocRoot=NULL; - + char* applicationName=NULL; + if (stURLComponents.stAppName.pszStart) + applicationName=strndup(stURLComponents.stAppName.pszStart, + stURLComponents.stAppName.iLength);//We'll need to release it + // copy headers copyHeaders(p_pRequestRec,pRequest); - + + if (applicationName) + GSWHTTPRequest_AddHeader(pRequest, + g_szHeader_GSWeb_ApplicationName, + applicationName); // Get Form data if any // POST Method if (pRequest->eMethod==ERequestMethod_Post @@ -706,11 +714,11 @@ GSWeb_Handler(request_rec *p_pRequestRec) ap_soft_timeout("Call GSWeb Application",p_pRequestRec); pRequest->pServerHandle = p_pRequestRec; pResponse=GSWAppRequest_HandleRequest(&pRequest, - &stURLComponents, - p_pRequestRec->protocol, - pszDocRoot, - g_szGSWeb_StatusResponseAppName, //AppTest name - pLogServerData); + &stURLComponents, + p_pRequestRec->protocol, + pszDocRoot, + g_szGSWeb_StatusResponseAppName, //AppTest name + pLogServerData); ap_kill_timeout(p_pRequestRec); // Send the response (if any) @@ -722,6 +730,8 @@ GSWeb_Handler(request_rec *p_pRequestRec) } else iRetVal = DECLINED; + if (applicationName) + free(applicationName); }; }; }; diff --git a/GSWAdaptors/common/GSWHTTPHeaders.c b/GSWAdaptors/common/GSWHTTPHeaders.c index e74d910..0f59587 100644 --- a/GSWAdaptors/common/GSWHTTPHeaders.c +++ b/GSWAdaptors/common/GSWHTTPHeaders.c @@ -60,6 +60,8 @@ const char *g_szHeader_GSWeb_GatewayInterface="x-gsweb-gateway-interface"; const char *g_szHeader_GSWeb_Protocol="x-gsweb-server-protocol"; const char *g_szHeader_GSWeb_ProtocolNum="x-gsweb-server-protocol-num"; const char *g_szHeader_GSWeb_RequestScheme="x-gsweb-request-scheme"; +const char *g_szHeader_GSWeb_ApplicationName="x-gsweb-application-name"; + const char *g_szHeader_Accept="accept"; const char *g_szHeader_AcceptEncoding="accept-encoding"; diff --git a/GSWAdaptors/common/GSWHTTPHeaders.h b/GSWAdaptors/common/GSWHTTPHeaders.h index 8b5ba29..733f542 100644 --- a/GSWAdaptors/common/GSWHTTPHeaders.h +++ b/GSWAdaptors/common/GSWHTTPHeaders.h @@ -43,6 +43,7 @@ extern const char *g_szHeader_GSWeb_GatewayInterface; extern const char *g_szHeader_GSWeb_Protocol; extern const char *g_szHeader_GSWeb_ProtocolNum; extern const char *g_szHeader_GSWeb_HTTPMethod; +extern const char *g_szHeader_GSWeb_ApplicationName; extern const char *g_szHeader_Accept; extern const char *g_szHeader_AcceptEncoding;