Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] org.eclipse.jetty.http.HttpField

Ohhh and yes section 2.3 doesn't comply with 2.6.... but 2.6 does only apply to "most" values.

... and you wonder why implementations of these specs sometimes get it wrong:)

On Fri, 30 Oct 2020, 00:32 Greg Wilkins, <gregw@xxxxxxxxxxx> wrote:
My first thought is that Nils could be right when he says that getValues is needlessly removing quotes.

That method was never really well specified as it's based in neither the http nor servlets specification. It was originally a jack of all trades method that worked for most cases.

We've not moved much of our previous handling to other methods like getCSV and getQualityCSV, with more precise behaviour.

In this case, getCSV passed a boolean to keep quotes will probably do the job you need.

I'll do a bit more of a review and comment more tomorrow if I get a chance,... But maybe Monday.

Cheers

On Thu, 29 Oct 2020, 22:28 Joakim Erdfelt, <joakim@xxxxxxxxxxx> wrote:
Per the spec you linked ...

     ETag       = entity-tag

     entity-tag = [ weak ] opaque-tag
     weak       = %x57.2F ; "W/", case-sensitive
     opaque-tag = DQUOTE *etagc DQUOTE
     etagc      = %x21 / %x23-7E / obs-text
                ; VCHAR except double quotes, plus obs-text

That means the "ETag" field is an "entity-tag"
Which can start with an optional "weak", and must have an "opaque-tag"

The definition fo "weak" is that it is always the 2 characters "W/" and the case must be preserved.

The "opaque-tag" is almost the same as what the http/1.1 spec level "quoted-string" definition is.
Except that it doesn't allow space character.

Greg, what's you take on this?
This would mean a new Special Case handling for a field value that isn't "Set-Cookie".
There's some accepted errata published after RFC7232 about ETag, but only related to space in etagc.
No errata on RFC7230 about other special case handling of field-values.

Joakim Erdfelt / joakim@xxxxxxxxxxx


On Thu, Oct 29, 2020 at 4:07 PM Cantor, Scott <cantor.2@xxxxxxx> wrote:
On 10/29/20, 4:54 PM, "jetty-users-bounces@xxxxxxxxxxx on behalf of Joakim Erdfelt" <jetty-users-bounces@xxxxxxxxxxx on behalf of joakim@xxxxxxxxxxx> wrote:

>    Your Example 2:
>    If-Match: W/"ab3>5ef1bc78", W/"5be73a9c523"
>
 >   This is a field of name "If-Match".
 >   It has 2 values, both of which are in violation of the spec.

https://tools.ietf.org/html/rfc7232#section-2.3

Am I missing something? That middle one seems to explicitly match your examples that you think are in violation...

(I don't mean to barge into the thread, but I have some uses of ETag in our code stack and I want to be able to accurately assess how we're using it.)

-- Scott


_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jetty-users
_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jetty-users

Back to the top