[ 
https://issues.apache.org/jira/browse/CXF-5508?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13878564#comment-13878564
 ] 

Sergey Beryozkin edited comment on CXF-5508 at 1/22/14 11:52 AM:
-----------------------------------------------------------------

I'm pretty the last change came after I did some TCK work,

So we have
{code:java}
public ResponseBuilder evaluatePreconditions(Date lastModified, EntityTag eTag) 
{
        final ResponseBuilder rb = evaluatePreconditions(eTag);
        if (rb == null) {
            // the ETag conditions match; so now conditions for last modified 
must match
            return evaluatePreconditions(lastModified);
        } else {
            // the ETag conditions do not match, so last modified should be 
ignored
            // see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html 
(section 14.26 for
            // "If-None-Match", behaviour not specified for "If-Match", section 
14.24)
            return null;
        }
    }
{code}

and the relevant text:

"If none of the entity tags match, then the server MAY perform the requested 
method as if the If-None-Match header field did not exist, but MUST also ignore 
any If-Modified-Since header field(s) in the request. That is, *if no entity 
tags match, then the server MUST NOT return a 304 (Not Modified) response*."

The code above will ignore If-Modified-Since if none of the entity tags match, 
i.e, if they match, then ResponseBuilder is null, and the dates are checked, 
but if they do not match then null is returned.
Where is the problem ?

Sergey


was (Author: sergey_beryozkin):
I'm pretty the last change came after I did some TCK work,

So we have
{code:java}
public ResponseBuilder evaluatePreconditions(Date lastModified, EntityTag eTag) 
{
        final ResponseBuilder rb = evaluatePreconditions(eTag);
        if (rb == null) {
            // the ETag conditions match; so now conditions for last modified 
must match
            return evaluatePreconditions(lastModified);
        } else {
            // the ETag conditions do not match, so last modified should be 
ignored
            // see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html 
(section 14.26 for
            // "If-None-Match", behaviour not specified for "If-Match", section 
14.24)
            return null;
        }
    }
{code}

and the relevant text:

"If none of the entity tags match, then the server MAY perform the requested 
method as if the If-None-Match header field did not exist, but MUST also ignore 
any If-Modified-Since header field(s) in the request. That is, *if no entity 
tags match, then the server MUST NOT return a 304 (Not Modified) response*."

The code above will ignore If-Modified-Since if none of the entity tags match, 
i.e, if they match, ResponseBuilder is not null, and the dates are checked, but 
of they do not match then null is returned.
Where is the problem ?

Sergey

> Bug CXF-4231 is back since 2.7.6
> --------------------------------
>
>                 Key: CXF-5508
>                 URL: https://issues.apache.org/jira/browse/CXF-5508
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.7.6
>            Reporter: Jan Engehausen
>
> The problem I reported in https://issues.apache.org/jira/browse/CXF-4231 is 
> back since 2.7.6; we noticed when upgrading to 2.7.8. See also 
> https://fisheye6.atlassian.com/browse/cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/RequestImpl.java?r2=1503661&r=1494596
> The concrete change/problematic part: if (rb != null) { => if (rb == null) {
> Any chance for a fix in the next release?



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to