felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r898696 - /felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/servlet/OsgiManagerHttpContext.java
Date Wed, 13 Jan 2010 10:14:03 GMT
Author: fmeschbe
Date: Wed Jan 13 10:14:03 2010
New Revision: 898696

URL: http://svn.apache.org/viewvc?rev=898696&view=rev
Log:
FELIX-1983 redo sending the 401/UNAUTHORIZED status to just use setStatus and then flush the
response. Don't use sendError to prevent any error handlers to kick in -- we really want the
401 status to be sent to the client.

Modified:
    felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/servlet/OsgiManagerHttpContext.java

Modified: felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/servlet/OsgiManagerHttpContext.java
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/servlet/OsgiManagerHttpContext.java?rev=898696&r1=898695&r2=898696&view=diff
==============================================================================
--- felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/servlet/OsgiManagerHttpContext.java
(original)
+++ felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/servlet/OsgiManagerHttpContext.java
Wed Jan 13 10:14:03 2010
@@ -136,15 +136,15 @@
         }
 
         // request authentication
-        response.setHeader( HEADER_WWW_AUTHENTICATE, AUTHENTICATION_SCHEME_BASIC + " realm=\""
+ this.realm + "\"" );
         try
         {
-            response.sendError( HttpServletResponse.SC_UNAUTHORIZED );
+            response.setHeader( HEADER_WWW_AUTHENTICATE, AUTHENTICATION_SCHEME_BASIC + "
realm=\"" + this.realm + "\"" );
+            response.setStatus( HttpServletResponse.SC_UNAUTHORIZED );
+            response.flushBuffer();
         }
         catch ( IOException ioe )
         {
-            // failed sending the error, fall back to setting the status
-            response.setStatus( HttpServletResponse.SC_UNAUTHORIZED );
+            // failed sending the response ... cannot do anything about it
         }
 
         // inform HttpService that authentication failed



Mime
View raw message