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

Sergey Beryozkin commented on CXF-6007:
---------------------------------------

Hmm, may be the whole condition there should be changed from:

{code:java}
protected void handleRetransmits() throws IOException {
            // If we have a cachedStream, we are caching the request.
            if (cachedStream != null
                || KNOWN_HTTP_VERBS_WITH_NO_CONTENT.contains(getMethod()) 
                   && (getClient().isAutoRedirect()) 
                       || authSupplier != null && 
authSupplier.requiresRequestCaching()) {
   //....
}
{code}

to

{code:java}
protected void handleRetransmits() throws IOException {
            // If we have a cachedStream, we are caching the request.
            if (cachedStream != null
                && 
                (getClient().isAutoRedirect() && 
KNOWN_HTTP_VERBS_WITH_NO_CONTENT.contains(getMethod()) 
                 || 
                 authSupplier != null && authSupplier.requiresRequestCaching()) 
{
   //....
}
{code}

> WebClient does not resend request in Digest authentication for HTTP methods 
> GET, HEAD, DELETE, OPTIONS (with no body).
> ----------------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-6007
>                 URL: https://issues.apache.org/jira/browse/CXF-6007
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS, Transports
>    Affects Versions: 3.0.0, 3.0.1
>         Environment: Windows 7, jdk1.7.0_65, cxf-rt-transports-http: 3.0.x
>            Reporter: Dmitriy Fedoriv
>            Assignee: Sergey Beryozkin
>             Fix For: 2.7.13, 3.0.2, 3.1.0
>
>
> Hi guys,
> I try to send DELETE, GET (auto-redirect disabled), HEAD, OPTIONS or any 
> other HTTP requests with no body used digest authentication to RESTful 
> service. In this case I always get "first" HTTP response with status code 401 
> - Unathorized but client does not resend "answer" with "WWW-Authenticate" 
> header.
> I had the assumption that the problem arises due to incorrect cache settings 
> in methods:
> 1) HTTPConduit.WrappedOutputStream.handleHeadersTrustCaching()
> and
> 2) HTTPConduit.WrappedOutputStream.handleRetransmits()).
> in package org.apache.cxf.transport.http.
> Is there any way to be properly authorized by the service (digest mode) in 
> these cases? 
> In my application I use, depending on the following versions of products:
> - javax.ws.rs-api: 2.0 
> - javax.annotation-api: 1.2 
> - cxf-core: 3.0.1 
> - cxf-rt-rs-client: 3.0.1 
> - cxf-rt-frontend-jaxrs: 3.0.1 
> - cxf-rt-transports-http: 3.0.1 
> - cxf-rt-transports-http-hc: 3.0.1 
> - httpasyncclient: 4.0.1 
> - httpclient: 4.3.2 
> - httpcore: 4.3.2 
> - httpcore-nio:4.3.2
> I look forward to your assistance. Thank you.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to