Created
September 20, 2013 14:24
-
-
Save karlbohlmark/6638374 to your computer and use it in GitHub Desktop.
IIS module set request header
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GLOBAL_NOTIFICATION_STATUS | |
OnGlobalPreBeginRequest( | |
IN IPreBeginRequestProvider * pProvider | |
) | |
{ | |
IHttpContext* pHttpContext = pProvider->GetHttpContext(); | |
IHttpRequest* pRequest = pHttpContext->GetRequest(); | |
char *szRange = "bytes=300-1000"; | |
HRESULT result = pRequest->SetHeader((PCSTR)"Range", (PCSTR) szRange, (USHORT) strlen(szRange), true /* replace header */); | |
if (FAILED(result)) { | |
WriteEventViewerLog( "Failed" ); | |
} | |
WriteEventViewerLog( "Add range header" ); | |
return GL_NOTIFICATION_CONTINUE; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I rely on the same code in the same function. but SetHeader is not apply by IIS 7.5: Range byte is well defined in OnGlobalTraceEvent function into RawHttpRequest !
do you have same issue ?