-
Notifications
You must be signed in to change notification settings - Fork 134
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
amp_cookie_test cookie values can contain disallowed characters #481
Comments
Thanks @mickaeltr for reporting this issue. We are currently looking into this, and we will get back to you soon. |
Thanks for fixing it! |
Hello @kevinpagtakhan, I am giving a second thought. |
In addition, it would be really great to cleanup ALL remaining |
@mickaeltr I am surprised these are not being cleaned up. For context, how much of this cookie are you still seeing before and after upgrading? |
Hello @kevinpagtakhan, thanks for replying. Here is an overview of the amount of errors we've met this week: I believe that the original issue (the disallowed characters in the cookie value) has been fixed, however it revealed another issue: it seems the The first thing I would do is to make sure that this test and this test too, are reliable (I feel like they're wrong): const cookieName = Constants.COOKIE_TEST_PREFIX + base64Id(); // generates a *first* random name
cookie.areCookiesEnabled(); // creates a cookie with a *second* random name
assert.isNull(cookie.get(`${cookieName}=`), null); // indeed there is no cookie with the first random name, but what about the second one? This is what I would expect from a newer version of the SDK:
Thanks for your help 🙏 (meanwhile, we're trying to see how we could filter this cookie out in our API gateway, or ignore them in the Java / Spring Boot code that rejects them with a 500 error) |
Expected Behavior
amp_cookie_test cookies should not be rejected by firewalls.
Current Behavior
amp_cookie_test cookie values can sometimes be rejected by firewalls, such as the Spring Security StrictHttpFirewall
Here is an example of a cookie that does not pass through the firewall, because of special characters (
\u0080\u0099
):amp_cookie_testZ4RgnufBu172SVyuXfqfSV=Sat Dec 18 2021 22:50:11 GMT+0100 (Ora standard dellâ\u0080\u0099Europa centrale);
Possible Solution
Maybe use something like
new Date().toUTCString()
rather thanString(new Date())
in base-cookies.jsSteps to Reproduce
Environment
The text was updated successfully, but these errors were encountered: