eclipse-ee4j / eclipse-ee4j/jersey

ContainerRequest.evaluatePreconditions violates RFC

Open
#4,974 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
730
Forks
382
PR merge metrics
No merged PRs in 30d

Description

ContainerRequest.evaluatePreconditions (and the related precondition handling methods) seem to have some violations of RFC 7232.

For example, section 6 clearly shows the order of processing of the various conditional headers, and that e.g. If-Unmodified-Since should not be processed if If-Match is present, and If-Modified-Since should not be processed if If-None-Match is present (regardless of whether they match or not).

Also, according to section 3.2 "A recipient MUST use the weak comparison function when comparing entity-tags for If-None-Match" whereas this implementation uses strong matching for all methods other than HEAD/GET (and moreover, in such a case a weak tag doesn't match the wildcard "*" either, which goes against the whole purpose of using a wildcard in a modifying request, as explained in the RFC).

I haven't done a comprehensive review, but at a glance some things seem to be off, probably more than those I just noticed.

I would recommend to go over the RFC, compare it with the current implementation, and fix the violations, or at least add a comment for every such violation (or loose interpretation) explicitly detailing how it deviates from the RFC and why it does so.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.