Return-Path: X-Original-To: apmail-sling-commits-archive@www.apache.org Delivered-To: apmail-sling-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 10B31735F for ; Wed, 23 Nov 2011 20:11:07 +0000 (UTC) Received: (qmail 5129 invoked by uid 500); 23 Nov 2011 20:11:07 -0000 Delivered-To: apmail-sling-commits-archive@sling.apache.org Received: (qmail 5088 invoked by uid 500); 23 Nov 2011 20:11:06 -0000 Mailing-List: contact commits-help@sling.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@sling.apache.org Delivered-To: mailing list commits@sling.apache.org Received: (qmail 5081 invoked by uid 99); 23 Nov 2011 20:11:06 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Nov 2011 20:11:06 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Nov 2011 20:11:04 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 7946823888FD; Wed, 23 Nov 2011 20:10:43 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1205562 - /sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/auth/AuthenticationResponseCodeTest.java Date: Wed, 23 Nov 2011 20:10:43 -0000 To: commits@sling.apache.org From: fmeschbe@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111123201043.7946823888FD@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: fmeschbe Date: Wed Nov 23 20:10:42 2011 New Revision: 1205562 URL: http://svn.apache.org/viewvc?rev=1205562&view=rev Log: SLING-2299 Browser check in the Sling Authenticator now uses the User-Agent (and not the Accept) header. Modified: sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/auth/AuthenticationResponseCodeTest.java Modified: sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/auth/AuthenticationResponseCodeTest.java URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/auth/AuthenticationResponseCodeTest.java?rev=1205562&r1=1205561&r2=1205562&view=diff ============================================================================== --- sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/auth/AuthenticationResponseCodeTest.java (original) +++ sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/auth/AuthenticationResponseCodeTest.java Wed Nov 23 20:10:42 2011 @@ -110,7 +110,7 @@ public class AuthenticationResponseCodeT final String requestUrl = HTTP_BASE_URL + "/junk?param1=1"; HttpMethod get = new GetMethod(requestUrl); get.setRequestHeader("Referer", requestUrl); - get.setRequestHeader("Accept", "text/*"); // simulate a browser request + get.setRequestHeader("User-Agent", "Mozilla/5.0 Sling Integration Test"); int status = httpClient.executeMethod(get); assertEquals(HttpServletResponse.SC_UNAUTHORIZED, status); } @@ -122,7 +122,7 @@ public class AuthenticationResponseCodeT List
headers = new ArrayList
(); headers.add(new Header("X-Requested-With", "XMLHttpRequest")); - headers.add(new Header("Accept", "text/html")); + headers.add(new Header("User-Agent", "Mozilla/5.0 Sling Integration Test")); HttpMethod post = assertPostStatus(HTTP_BASE_URL + "/j_security_check", HttpServletResponse.SC_FORBIDDEN, params, headers, null); @@ -164,7 +164,7 @@ public class AuthenticationResponseCodeT params.add(new NameValuePair("j_password", "garbage")); List
headers = new ArrayList
(); - headers.add(new Header("Accept", "application/xml")); + headers.add(new Header("User-Agent", "Mozilla/5.0 Sling Integration Test")); assertPostStatus(HTTP_BASE_URL + "/j_security_check", HttpServletResponse.SC_UNAUTHORIZED, params, null); }