Skip to content

Commit 4c1b6f1

Browse files
committed
Changed encodeURL logic in servlet response
The encodeURL should only encode when it is necessary and it’s adding a session id to the URL for browsers that do not support cookies. The framework doesn’t support cookies or session tracking so changed the methods to return the plain urls. This addresses issue #27
1 parent 463295d commit 4c1b6f1

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

aws-serverless-java-container-core/src/main/java/com/amazonaws/serverless/proxy/internal/servlet/AwsHttpServletResponse.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,25 +91,29 @@ public boolean containsHeader(String s) {
9191

9292
@Override
9393
public String encodeURL(String s) {
94-
return URLEncoder.encode(s);
94+
// We do not support session tracking using the URL right now, we do not encode urls
95+
return s;
9596
}
9697

9798

9899
@Override
99100
public String encodeRedirectURL(String s) {
100-
return URLEncoder.encode(s);
101+
// Return the URL without changing it, we do not support session tracking using URLs
102+
return s;
101103
}
102104

103105

104106
@Override
107+
@Deprecated
105108
public String encodeUrl(String s) {
106-
return URLEncoder.encode(s);
109+
return this.encodeURL(s);
107110
}
108111

109112

110113
@Override
114+
@Deprecated
111115
public String encodeRedirectUrl(String s) {
112-
return URLEncoder.encode(s);
116+
return this.encodeRedirectURL(s);
113117
}
114118

115119

0 commit comments

Comments
 (0)