Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jetty 12 content length 0 take3 #9740

Merged
merged 6 commits into from
May 7, 2023
Merged

Conversation

gregw
Copy link
Contributor

@gregw gregw commented May 5, 2023

Create and use a pre-encoded HttpFields.CONTENT_LENGTH_0 constant
Used the constant in more places
renamed the putLongField methods of HttpFields.Mutable to just put

(third attempt after forced push zero event incident!)

gregw added 5 commits May 5, 2023 10:47
Create and use a pre-encoded HttpFields.CONTENT_LENGTH_0 constant
Used the constant in more places
renamed the `putLongField` methods of HttpFields.Mutable to just `put`
Create and use a pre-encoded HttpFields.CONTENT_LENGTH_0 constant
Used the constant in more places
renamed the `putLongField` methods of HttpFields.Mutable to just `put`
Create and use a pre-encoded HttpFields.CONTENT_LENGTH_0 constant
Used the constant in more places
renamed the `putLongField` methods of HttpFields.Mutable to just `put`
…ent-Length-0-take3

# Conflicts:
#	jetty-ee10/jetty-ee10-servlet/src/main/java/org/eclipse/jetty/ee10/servlet/ServletApiResponse.java
@gregw gregw requested review from sbordet and joakime May 5, 2023 18:41
@joakime
Copy link
Contributor

joakime commented May 5, 2023

As I was looking around at our CONTENT_LENGTH usage (in this branch), I was struck by an apparent set of bugs in the jetty-documentation's server/HandlerDocs.

https://github.com/eclipse/jetty.project/blob/897611d7361ac8f13a538d8c86016477d8af5e3e/documentation/jetty-documentation/src/main/java/org/eclipse/jetty/docs/programming/server/HandlerDocs.java#L45

There's 8 occurrences of this line in the above file.
@sbordet is this intended? or a bug?

@joakime
Copy link
Contributor

joakime commented May 5, 2023

@gregw
Copy link
Contributor Author

gregw commented May 6, 2023

@joakime I'll fix those in this PR as well....

@gregw
Copy link
Contributor Author

gregw commented May 6, 2023

Note also that it is kind of a bug to add headers like CONTENT_LENGTH and CONTENT_TYPE as there should only be 1 of those. Thus put should be used. Should we produce a warning if somebody adds one of these?

@gregw
Copy link
Contributor Author

gregw commented May 7, 2023

@joakime I fixed the CONTENT_LENGTH->CONTENT_TYPE ones, as they are kind of related to this. But I've left the FCGI one alone, as I'm not sure if that is a bug or not (looks deliberate).

@gregw gregw merged commit 4c16e6a into jetty-12.0.x May 7, 2023
@gregw gregw deleted the jetty-12-Content-Length-0-take3 branch May 7, 2023 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants