Skip to content

Commit

Permalink
Merge pull request mitre#42 from chw-1/patch-1
Browse files Browse the repository at this point in the history
Fix mitre#41 Copied cookie path may be invalid
  • Loading branch information
dsmiley committed Dec 12, 2014
2 parents 4743d29 + 732a03a commit cace57e
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/main/java/org/mitre/dsmiley/httpproxy/ProxyServlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -441,11 +441,8 @@ protected void copyResponseHeaders(HttpResponse proxyResponse, HttpServletReques
protected void copyProxyCookie(HttpServletRequest servletRequest,
HttpServletResponse servletResponse, Header header) {
List<HttpCookie> cookies = HttpCookie.parse(header.getValue());
String path = getServletContext().getServletContextName();
if (path == null) {
path = "";
}
path += servletRequest.getServletPath();
String path = servletRequest.getContextPath(); // path starts with / or is empty string
path += servletRequest.getServletPath(); // servlet path starts with / or is empty string

for (HttpCookie cookie : cookies) {
//set cookie name prefixed w/ a proxy value so it won't collide w/ other cookies
Expand Down

0 comments on commit cace57e

Please sign in to comment.