Giter Site home page Giter Site logo

To ignore bad etags or not about ldp-testsuite HOT 7 CLOSED

w3c avatar w3c commented on September 3, 2024
To ignore bad etags or not

from ldp-testsuite.

Comments (7)

sspeiche avatar sspeiche commented on September 3, 2024

The language you quote is for "If-Modified-Since" and the test in
"testPutBadETags" is testing "If-Match" header usage with PUT.

I don't think there is a problem. testPutBadETags doesn't expect when the
value is "not well-formatted", it is well-formatted entity-tag. It expects
to find a value for ETag such that it won't match a value on the server to
therefore generate the 412 response per the spec.

I can't find any language otherwise in RFC 7232 for If-Match.

Thanks,
Steve Speicher
http://stevespeicher.me

On Wed, Jun 25, 2014 at 4:26 AM, Fernando Serena Acedo <
[email protected]> wrote:

RFC 7232 http://tools.ietf.org/html/rfc7232 says:

"A recipient MUST ignore the If-Modified-Since header field if the
received field-value is not a valid HTTP-date, or if the request method is
neither GET nor HEAD."

Should not the servers behave the same way with bad ETags? Currently,
testPutBadETags expects a 412 when the value is not well-formatted. In that
case, I think LDP servers should ignore the If-Match header and return a
428 (precondition required) or a 2xx.


Reply to this email directly or view it on GitHub
#70.

from ldp-testsuite.

spadgett avatar spadgett commented on September 3, 2024

Reading RFC2616, I believe the only requirement for an ETag is that it's quoted (optionally with a leading W/ for weak ETags). So in that sense the value is well-formed.

http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.19

It might a better test to do one successful PUT first, then try again with the stale ETag value.

from ldp-testsuite.

spadgett avatar spadgett commented on September 3, 2024

A better link:

http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.11

  entity-tag = [ weak ] opaque-tag
  weak       = "W/"
  opaque-tag = quoted-string

from ldp-testsuite.

sspeiche avatar sspeiche commented on September 3, 2024

Also as we've explored, many implementations don't enforce the quoting.
Though we are a compliance testsuite and should complain when it doesn't
follow the rules.

Thanks,
Steve Speicher
http://stevespeicher.me

On Wed, Jun 25, 2014 at 11:49 AM, Samuel Padgett [email protected]
wrote:

A better link:

http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.11

entity-tag = [ weak ] opaque-tag
weak = "W/"
opaque-tag = quoted-string


Reply to this email directly or view it on GitHub
#70 (comment).

from ldp-testsuite.

spadgett avatar spadgett commented on September 3, 2024

True. And, for what it's worth, testPutBadETag does send a quoted string.

One other point, and then I'll stop spamming :) ...

There's no danger in ignoring a bad If-Modified-Since header because it's simply a caching optimization. Ignoring a bad ETag header, however, could result in data loss.

from ldp-testsuite.

fserena avatar fserena commented on September 3, 2024

I agree.

But although it seems common sense once discussed, this behavior is not described in the specification. I mean, I'm afraid that nowhere says that if the ETag is badly formatted the server should return a 412.

from ldp-testsuite.

sspeiche avatar sspeiche commented on September 3, 2024

We are sending a properly formatted but non-existant ETag. So we are testing 412 in that case. I could see strict servers returning any of a number of possible 4xx values if ETag was formatted improperly or just accepting it.

from ldp-testsuite.

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.