Giter VIP home page Giter VIP logo

Comments (8)

gregw avatar gregw commented on June 1, 2024

I believe Jetty does follow that. We make every effort to not use close delimitation. But in this case the client is asking for it and we are bound to follow that.

from jetty.project.

joakime avatar joakime commented on June 1, 2024

Checking the updated RFCs ...

in RFC9110 ...

https://datatracker.ietf.org/doc/html/rfc9110#section-6.1

A message is considered "complete" when all of the octets indicated
by its framing are available. Note that, when no explicit framing is 
used, a response message that is ended by the underlying connection's 
close is considered complete even though it might be 
indistinguishable from an incomplete response, unless a transport-
level error indicates that it is not complete.

And in RFC9112 ...

https://datatracker.ietf.org/doc/html/rfc9112#name-message-body-length

Since there is no way to distinguish a successfully completed, 
close-delimited response message from a partially received message interrupted
by network failure, a server SHOULD generate encoding or 
length-delimited messages whenever possible. The close-delimiting 
feature exists primarily for backwards compatibility with HTTP/1.0.

from jetty.project.

gregw avatar gregw commented on June 1, 2024

See https://datatracker.ietf.org/doc/html/rfc9112#name-tear-down, that shows that HTTP/1.1 still supports the connection:close semantic.
Now potentially we could also set a content-length as well as closing.

from jetty.project.

joakime avatar joakime commented on June 1, 2024

@gregw there's a reported demo project that can replicate this in Jetty 12 - https://github.com/techsup69/jetty-cont-len-12

from jetty.project.

joakime avatar joakime commented on June 1, 2024

See stackoverflow question for curl command line to trigger it - https://stackoverflow.com/questions/77822470/jetty-12-spring-6-missing-content-length-in-response

from jetty.project.

gregw avatar gregw commented on June 1, 2024

Hmmmm we do put the content length in even in the case of an EOF message... I'll respond in stackoverflow with some questions

from jetty.project.

gregw avatar gregw commented on June 1, 2024

Perhaps in the case of a forced Connection:close for HTTP/1.1 where the content-length is not known, then we could use chunking and connection:close. Feels like optimizing the slow/bad case.

from jetty.project.

joakime avatar joakime commented on June 1, 2024

Perhaps in the case of a forced Connection:close for HTTP/1.1 where the content-length is not known, then we could use chunking and connection:close. Feels like optimizing the slow/bad case.

I see the point of view of the users and the spec here. That the close-delimited response message IS the bad to horrible case for HTTP/1.1 use.

As the current HTTP/1.1 specs point out this close-delimited response message behavior is only for backward compatibility with HTTP/1.0, and its use in HTTP/1.1 discouraged in use as it is indistinguishable from a partially received response message that is interrupted by a network failure. The current specs use "SHOULD generate encoding or length-delimited messages whenever possible" as guidance.

from jetty.project.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.