简体   繁体   中英

HTTP Chunked response error handling

I'm building a web app that chunk outputs back to the client in Java netty.

I've read and searched the internet and found the following resources:

and to summarize, I am lead to believe that trailer-headers with "Location" should be respected regardless of the http response and or prior headers.

However after some blackbox testing on Firefox and Chrome. Neither browser respects the trailing header.

So my question is

  • first of all have I missed something?
  • Secondly, what would be the ideal solution to deal with errors in chunked response?
    • I am only currently aware of using javascripts in the middle of a response.
  • and finally, am I wrong in believing HTTP Location headers should be respected regardless of http response code? The specification as I linked above made no mention it must be 3xx headers and in fact mentioned 201 headers as a possible case for Location as well but none of the major browsers respect it.

First of all, UAs (AFAIK) do not support trailers.

Second, the semantics of Location depend on the status code. What do you think should happen with a Location header field upon a status 200???

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM