2

While reading RFC2616, I came across TE and Transfer Encoding headers for chunked encoding. I have following question on these:

  1. If a HTTP Server rejects a request because of presence of TE header, is it RFC compliant?
  2. If a HTTP Client sends a request with TE header and list of t-codings and q values and once such q value is 1, is it mandatory for HTTP server to send the response data with that encoding, for eg: TE: deflat;q=0.5 gzip;q=1 (Does this mandate server to compress entity data in gzip and send it or can server ignore that and send data in normal way?).
  3. If a HTTP server does not support reception of chunked data (I am aware that it goes against RFC, but is intended), what could be the right error response code to be sent back to the client so that client next time does not send PUT request in chunked fashion.

Thanks in advance for your valuable inputs and answers.

Vamsi Mohan
  • 307
  • 1
  • 5
  • 13
  • Please read RFC 7230 and 7231 and see whether they answer these questions. – Julian Reschke Jun 10 '14 at 10:16
  • Is this a rehashed version of RFC2616 or are there any new standards prescribed in RFC. – Vamsi Mohan Jun 10 '14 at 16:26
  • @VamsiMohan 723* are revised and updated versions of 2616 intended to clarify the specification. Calling them "rehashed" is offensive to the people who have put a massive amount of work into this project, as the new specifications are a huge improvement. – Darrel Miller Aug 20 '14 at 14:25
  • Sorry.. I did not mean to be offensive at all but was trying to get the nutshell of this RFC before I proceed reading it. Apologies again!! – Vamsi Mohan Aug 22 '14 at 11:10

1 Answers1

2

In RFC 7230 it says,

The "TE" header field in a request indicates what transfer codings,
besides chunked, the client is willing to accept in response, and
whether or not the client is willing to accept trailer fields in a
chunked transfer coding.

This infers that TE is simply a declaration by the client and can be ignored by next server. There should be no reason for a HTTP server to reject a request with a TE header. If a server does not support chunked then it does not support HTTP 1.1 and therefore should interpret the incoming request as if it were a 1.0 request and respond accordingly. See here.

Community
  • 1
  • 1
Darrel Miller
  • 139,164
  • 32
  • 194
  • 243