incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
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 GMT
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<Header> headers = new ArrayList<Header>();
         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<Header> headers = new ArrayList<Header>();
-        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);
     }



Mime
View raw message