-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[rb] Permit case insensitive sameSite
attribute on cookie creation
#16096
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
base: trunk
Are you sure you want to change the base?
Conversation
This handles situations where you get a direct injection from a valid set-header response in API requests
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
What issue is this solving? |
The issue being resolved is when you get a cookie response that is invalidly cased. However speaking on slack it maybe should be bubbled up to driver vendors to permit people submitting it case insensitively When selenium sets this attribute with the wrong case it crashes the driver. i.e. setting "lax" is an invalid value but "Lax" is a valid value |
It does sound like something that needs to be raised with the browser driver. Is this happening for all browser drivers? |
I'm not 100%. I have just patched this here because I've done an equivalent patch on my end for chrome. In my current job I do not use much other than chrome (I could use firefox I figure, but I don't yet). |
OK, so I don't think this makes sense as a workaround in Selenium. It should be raised to the driver. Could you please help us with that? Thanks! |
User description
This handles situations where you get a direct injection from a valid set-header response in API requests
🔗 Related Issues
N/A
💥 What does this PR do?
Change the behaviour of create cookie to permit
lax
as a valid input.It seems that something on the browser level is not permitting this as a valid attribute, but this is regularly returned by API requests. It becomes hard to triage
🔧 Implementation Notes
💡 Additional Considerations
Should this be implemented polyglot @diemol ?
🔄 Types of changes
PR Type
Bug fix
Description
Capitalize
sameSite
cookie attribute values for browser compatibilityHandle case-insensitive input from API responses
Fix cookie creation when receiving lowercase values
Diagram Walkthrough
File Walkthrough
manager.rb
Capitalize sameSite cookie attribute values
rb/lib/selenium/webdriver/common/manager.rb
add_cookie
method to capitalizesameSite
attribute values.capitalize
method