Author: dehort
Date: 2011-01-05 17:46:57 -0500 (Wed, 05 Jan 2011)
New Revision: 1634
Modified:
branches/JBOSSWEB_2_0_0_GA_CP08_JBPAPP-5727/src/share/classes/org/apache/catalina/authenticator/FormAuthenticator.java
Log:
Fixed a bug where after repeated authentication tomcat again sends page with login form
instead of protected static resource
[JBPAPP-5727]
Modified:
branches/JBOSSWEB_2_0_0_GA_CP08_JBPAPP-5727/src/share/classes/org/apache/catalina/authenticator/FormAuthenticator.java
===================================================================
---
branches/JBOSSWEB_2_0_0_GA_CP08_JBPAPP-5727/src/share/classes/org/apache/catalina/authenticator/FormAuthenticator.java 2011-01-05
22:11:09 UTC (rev 1633)
+++
branches/JBOSSWEB_2_0_0_GA_CP08_JBPAPP-5727/src/share/classes/org/apache/catalina/authenticator/FormAuthenticator.java 2011-01-05
22:46:57 UTC (rev 1634)
@@ -402,12 +402,20 @@
MimeHeaders rmh = request.getCoyoteRequest().getMimeHeaders();
rmh.recycle();
+ boolean cachable = "GET".equalsIgnoreCase(saved.getMethod()) ||
+ "HEAD".equalsIgnoreCase(saved.getMethod());
Iterator names = saved.getHeaderNames();
while (names.hasNext()) {
String name = (String) names.next();
- Iterator values = saved.getHeaderValues(name);
- while (values.hasNext()) {
- rmh.addValue(name).setString( (String)values.next() );
+ // The browser isn't expecting this conditional response now.
+ // Assuming that it can quietly recover from an unexpected 412.
+ // BZ 43687
+ if(!("If-Modified-Since".equalsIgnoreCase(name) ||
+ (cachable && "If-None-Match".equalsIgnoreCase(name))))
{
+ Iterator values = saved.getHeaderValues(name);
+ while (values.hasNext()) {
+ rmh.addValue(name).setString( (String)values.next() );
+ }
}
}
Show replies by date