Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue-1759 Fixing NLP for invalid cookie value #1782

Merged
merged 2 commits into from
Oct 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import static java.util.Objects.nonNull;
import java.util.Set;
import java.util.function.Supplier;
import org.graalvm.polyglot.Value;
Expand Down Expand Up @@ -122,7 +123,10 @@ public Map<String, Map> getCookies() {
Map<String, Map> map = new HashMap();
for (String value : values) {
Cookie cookie = ClientCookieDecoder.STRICT.decode(value);
map.put(cookie.name(), Cookies.toMap(cookie));
// skipping cookie containing invalid char
if(nonNull(cookie)) {
map.put(cookie.name(), Cookies.toMap(cookie));
}
}
return map;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,8 @@ void testMultipart() {
run("upload.feature");
}

@Test
void testInvalidCookie() {
run("invalid-cookie.feature");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,7 @@ Scenario: pathMatches('/v1/html')
<h1>Hello</h1>
</body>
</html>
"""
"""

Scenario: pathMatches('/v1/invalid-cookie')
* def responseHeaders = { 'Set-Cookie': 'detectedTimeZoneId=FLE Standard Time' }
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Feature:

Background:
* url mockServerUrl

Scenario:
* path 'invalid-cookie';
* method get
* status 200