ASF Bugzilla – Attachment 21161 Details for
Bug 43914
HTTP spec violation when generating HTTP redirects for folders without trailing slash
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
simple fix
tomcat6-http-redirect-fix.patch (text/plain), 1.87 KB, created by
Ivan Todoroski
on 2007-11-20 05:57:38 UTC
(
hide
)
Description:
simple fix
Filename:
MIME Type:
Creator:
Ivan Todoroski
Created:
2007-11-20 05:57:38 UTC
Size:
1.87 KB
patch
obsolete
>diff -u -r apache-tomcat-6.0.14-src.orig/java/org/apache/catalina/connector/CoyoteAdapter.java apache-tomcat-6.0.14-src/java/org/apache/catalina/connector/CoyoteAdapter.java >--- apache-tomcat-6.0.14-src.orig/java/org/apache/catalina/connector/CoyoteAdapter.java 2007-07-20 05:21:18.000000000 +0200 >+++ apache-tomcat-6.0.14-src/java/org/apache/catalina/connector/CoyoteAdapter.java 2007-11-20 14:32:41.171875000 +0100 >@@ -25,6 +25,7 @@ > import org.apache.catalina.Globals; > import org.apache.catalina.Wrapper; > import org.apache.catalina.util.StringManager; >+import org.apache.catalina.util.URLEncoder; > import org.apache.coyote.ActionCode; > import org.apache.coyote.Adapter; > import org.apache.juli.logging.Log; >@@ -101,6 +102,28 @@ > StringManager.getManager(Constants.Package); > > >+ /** >+ * Encoder for the Location URL in HTTP redirects. >+ */ >+ protected static URLEncoder urlEncoder; >+ >+ >+ // ----------------------------------------------------- Static Initializer >+ >+ >+ /** >+ * The safe character set. >+ */ >+ static { >+ urlEncoder = new URLEncoder(); >+ urlEncoder.addSafeCharacter('-'); >+ urlEncoder.addSafeCharacter('_'); >+ urlEncoder.addSafeCharacter('.'); >+ urlEncoder.addSafeCharacter('*'); >+ urlEncoder.addSafeCharacter('/'); >+ } >+ >+ > // -------------------------------------------------------- Adapter Methods > > >@@ -452,7 +475,7 @@ > // Possible redirect > MessageBytes redirectPathMB = request.getMappingData().redirectPath; > if (!redirectPathMB.isNull()) { >- String redirectPath = redirectPathMB.toString(); >+ String redirectPath = urlEncoder.encode(redirectPathMB.toString()); > String query = request.getQueryString(); > if (request.isRequestedSessionIdFromURL()) { > // This is not optimal, but as this is not very common, it
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 43914
:
21160
| 21161