Author: dehort
Date: 2011-01-05 16:07:08 -0500 (Wed, 05 Jan 2011)
New Revision: 1632
Modified:
branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/authenticator/FormAuthenticator.java
Log:
[JBWEB-119] After repeated authentication tomcat again sends page with login form instead
of protected static resource
Modified:
branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/authenticator/FormAuthenticator.java
===================================================================
---
branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/authenticator/FormAuthenticator.java 2011-01-05
17:35:54 UTC (rev 1631)
+++
branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/authenticator/FormAuthenticator.java 2011-01-05
21:07:08 UTC (rev 1632)
@@ -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