HTTP Post Request, HTTP/1.0 fallback, produces error due additional response headers #589
Replies: 3 comments
-
An HTTP/1.1 server is allowed to send an HTTP/1.1 response to an HTTP/1.0 request, but it should not rely on the client being able to understand new headers introduced in HTTP/1.1. Is the server actually sending an HTTP/1.1 response, or is it sending an HTTP/1.0 response? What does the Regarding the The In any case, ideally That being said, the HTTP/1.1 spec does say:
So, the server is clearly flawed when sending the response you have shown, when |
Beta Was this translation helpful? Give feedback.
-
Hi, I'am not sure if the RFC says, the response shall or must not contain any header values which a 1.0 client can't understand? If it is a shall in the RFC - I think if TidHTTP switches back to 1.0 for the "post" operation - it should parse also the response at the 1.0 level and ignore every 1.1 header value - like Transfer-Encoding and so on. Currently I can work with the HTTPOptions = [hoKeepOrigProtocol] to disable the HTTP/1.0 fallback this produces a valid response. Is this fallback to HTTP 1.0 still required in the year 2022? Are still there servers online which can't handle a HTTP/1.1 POST command in a Indy compatible manner? -- the full response header --
|
Beta Was this translation helpful? Give feedback.
-
All I can find is this blurb from RFC 2145 Section 2.2:
As pointed out earlier, there are clear faults in the server response anyway, so the server admins should look into fixing them.
I don't know. Probably not. Who knows. |
Beta Was this translation helpful? Give feedback.
-
The following situation happened to us:
We are sending XML datastructures to a server useing POST - inside the INDY code the protocol version is set to HTTP 1.0 so far ok
(useing the HTTPOption to disable this behavior resolves the problem)
The response contains also some headers that are not 1.0 available like "Transfer-Encoding: chunked" -- I'am not sure if that was specified for HTTP 1.0?
But the response from the server isn't chunked the length information before the true content is missing - that leads to errors ("like line length execeeded" if the content has more than 16k bytes)
My question is - if the protocolversion is reduced to HTTP 1.0 - shouldn't the response handling ignore header entries which are not valid for the requested HTTP Protocol version?
Or is it in this case better to forward the problem to the server developers?
Another Issue with that response and the code handling the headers inside TIdHTTP - if headers are repeated only the first value is taken into account - the same server also returns this:
Indy believes the connection=keep-alive, .. but the server closes the connection .. like told in the last header line.
Beta Was this translation helpful? Give feedback.
All reactions