You are not logged in.
I have created a vcl form application and created an instance of THttpApiServer class. In the OnRequest event I would like to set the version of the response to set it as HTTP/1.0 instead of HTTP/1.1.
For example, when I receive a request in this format : GET /../jpg/image.cgi HTTP/1.1 .....
I would like to response with : HTTP/1.0 200 OK .... Content-Type: image/jpeg ....
Thank you and best regards.
Offline
Set the appropriate output header.
Thank you, but in the OnRequest procedure I have the Ctxt: THttpServerRequest parameter. I have tried to set the Ctxt.OutCustomHeaders to HTTP/1.0 200 OK and Content-Type: image/jpeg but it does not work, I have sniffed the result and it always return HTTP/1.1 200 OK ..., I do not know how to set the output header. I have stopped the code when I set Result := 200 and followed the code line by line until the execution code return to the procedure THttpApiServer.Execute and I observed that the code arrives until :
EHttpApiServer.RaiseOnError(hSendHttpResponse,Http.SendHttpResponse(fReqQueue,Req^.RequestId,0,Resp^,nil,bytesSent,nil,0,nil,fLogData));
And in the Req^.Version.MajorVersion is 1 and Req^.Version.MinorVersion is 1, so I suspect that the HTTP/1.1 200 OK is responsed by the http.sys because I do not see it in any structure of the Req^ pointer.
Can you help me to set the appropiate header?.
Thank you and best regards.
Offline