-
Notifications
You must be signed in to change notification settings - Fork 109
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
Unquote Sec-CH-UA-Platform and Sec-CH-UA-Platform-Version #123
base: develop
Are you sure you want to change the base?
Conversation
Clients provide these in quoted form References: * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-UA-Platform * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-UA-Platform-Version
@@ -177,5 +177,9 @@ def extract_model | |||
|
|||
headers['Sec-CH-UA-Model'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ran into this issue too. I believe we also need to unquote 'Sec-CH-UA-Model'
, which is also wrapped, at least on MacOS Chrome.
@@ -4465,10 +4465,10 @@ | |||
family: Chrome | |||
headers: | |||
Sec-CH-UA: '" Not A;Brand";v="99.0.0.0", "Chromium";v="98.0.4758.109", "Gener8";v="98.0.4758.109"' | |||
Sec-CH-UA-Platform: "Windows" | |||
Sec-CH-UA-Platform: '"Windows"' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, these kind of changes will be overwritten on the first fixtures sync from the upstream: fixtures are not updated manually. There is bundle exec rake update_fixtures
specifically for that:
Lines 69 to 88 in e68ee76
desc 'update fixtures from piwik project' | |
task :update_fixtures do | |
top = File.expand_path(__dir__) | |
get_latest_piwik_checkout | |
fixture_mappings = [ | |
{ target_path: "#{top}/spec/fixtures/detector", source_path: 'Tests/fixtures/*.yml' }, | |
{ target_path: "#{top}/spec/fixtures/client", | |
source_path: 'Tests/Parser/Client/fixtures/*.yml' }, | |
{ target_path: "#{top}/spec/fixtures/parser", source_path: 'Tests/Parser/fixtures/*.yml' }, | |
{ target_path: "#{top}/spec/fixtures/device", | |
source_path: 'Tests/Parser/Device/fixtures/*.yml' } | |
] | |
fixture_mappings.each do |mapping| | |
source_path = mapping.fetch(:source_path) | |
target_path = mapping.fetch(:target_path) | |
system "cp -R #{PIWIK_CHECKOUT_LOCATION}/#{source_path} #{target_path}" | |
end | |
end |
I would suggest to add a dedicated test for the unquote
functionality outside of the existing fixtures. Some examples can be found in here: https://github.com/podigee/device_detector/tree/develop/spec/device_detector
Hi everyone! If you think there's something that should be changed upstream, it will be much better to open an issue there. |
Since clients provide these headers in quoted form, the related logic is off in real-world use.
References: