[
https://issues.apache.org/jira/browse/WINK-72?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Nadav Fischer updated WINK-72:
------------------------------
Attachment: WINK-72.update.patch
Good catch Mike, and this isn't nit-picky at all - it's a real bug.
The bug is in the EntityTagHeaderDelegate class (line 44) - the existence of
the quotes isn't checked correctly, so that needs to be fixed.
BTW, I think that if the quotes don't appear correctly (start and end) then
the behavior should be to return a 400 (BAD REQUEST), and not 412 (PRECONDITION
FAILED). The reason for this is that it seems to me that a malformed ETag is a
_syntax_ error that translates to 400, whereas a correctly formed ETag failing
is a _semantic_ error that translates to 412.
I'm attaching an updated patch (WINK-72.updated.patch) that fixes the bug in
EntityTagHeaderDelegate along with the proposed behavior for the malformed
ETag.
Let me know what you think.
> consistent behavior for mis-quoted etag header values
> -----------------------------------------------------
>
> Key: WINK-72
> URL: https://issues.apache.org/jira/browse/WINK-72
> Project: Wink
> Issue Type: Bug
> Components: Server
> Affects Versions: 0.1
> Reporter: Mike Rheinheimer
> Assignee: Nadav Fischer
> Fix For: 0.1
>
> Attachments: patch.txt, WINK-72.update.patch
>
>
> Currently, the runtime will throw an IllegalArgumentException (and thus a 500
> response code) if an ETag (in the form of an If-Match or If-None-Match header
> value) with no quotes is passed to the server. If the ETag has a single
> quote at the front, or a single quote at the back, but is not fully wrapped,
> we'll get a 412 response code. I know this is very nit-picky, but I'd like
> to see consistency here.
> Current behavior:
> "etag" --> success
> "etag --> 412
> etag" --> 412
> etag --> 500
> Desired behavior is for that 500 to be a 412. Please see patch, which has
> tests and fix.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.