Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C136F18527 for ; Fri, 15 Jan 2016 03:35:55 +0000 (UTC) Received: (qmail 12897 invoked by uid 500); 15 Jan 2016 03:35:55 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 12830 invoked by uid 500); 15 Jan 2016 03:35:55 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 12821 invoked by uid 99); 15 Jan 2016 03:35:55 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Jan 2016 03:35:55 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 46BDFDFBA7; Fri, 15 Jan 2016 03:35:55 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ffang@apache.org To: commits@cxf.apache.org Message-Id: <0a12a47ec65c4e9695bdf44f9b23ec44@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: cxf git commit: [CXF-6748]the qop, nc, algorithm parameter in http auth header must not be enclosed between doble quotation Date: Fri, 15 Jan 2016 03:35:55 +0000 (UTC) Repository: cxf Updated Branches: refs/heads/3.0.x-fixes 0e140596b -> cb0d7506c [CXF-6748]the qop,nc,algorithm parameter in http auth header must not be enclosed between doble quotation (cherry picked from commit bf4f4c89b61640faa41dbac68cf591cb923eb144) (cherry picked from commit b0035ade0042160b77b4848939f58efe9a77d6c7) Conflicts: rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/HttpAuthHeader.java Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/cb0d7506 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/cb0d7506 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/cb0d7506 Branch: refs/heads/3.0.x-fixes Commit: cb0d7506c1fe3a59fa513ffb02f9551a0e6aa69e Parents: 0e14059 Author: Freeman Fang Authored: Thu Jan 14 17:23:43 2016 +0800 Committer: Freeman Fang Committed: Fri Jan 15 11:35:22 2016 +0800 ---------------------------------------------------------------------- .../cxf/transport/http/auth/HttpAuthHeader.java | 26 +++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/cb0d7506/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/HttpAuthHeader.java ---------------------------------------------------------------------- diff --git a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/HttpAuthHeader.java b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/HttpAuthHeader.java index 5b32dbf..eee12dc 100644 --- a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/HttpAuthHeader.java +++ b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/HttpAuthHeader.java @@ -84,7 +84,13 @@ public final class HttpAuthHeader { if (!first) { builder.append(", "); } - builder.append(key + "=\"" + param + "\""); + if ("nc".equals(key) + || "qop".equals(key) + || "algorithm".equals(key)) { + builder.append(key + "=" + param + ""); + } else { + builder.append(key + "=\"" + param + "\""); + } first = false; } } @@ -99,14 +105,28 @@ public final class HttpAuthHeader { tok.quoteChar('\''); tok.whitespaceChars('=', '='); tok.whitespaceChars(',', ','); - + while (tok.nextToken() != StreamTokenizer.TT_EOF) { String key = tok.sval; if (tok.nextToken() == StreamTokenizer.TT_EOF) { map.put(key, null); return map; } - String value = tok.sval; + String value = null; + if ("nc".equals(key)) { + //nc is a 8 length HEX number so need get it as number + value = String.valueOf(tok.nval); + if (value.indexOf(".") > 0) { + value = value.substring(0, value.indexOf(".")); + } + String pad = ""; + for (int i = 0; i < 8 - value.length(); i++) { + pad = pad + "0"; + } + value = pad + value; + } else { + value = tok.sval; + } map.put(key, value); } } catch (IOException ex) {