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

Fixed calls to toLowerCase() to be toLowerCase(Locale.US) instead. #420

Merged
merged 1 commit into from Aug 2, 2018

Conversation

jeanbza
Copy link
Member

@jeanbza jeanbza commented Jul 10, 2018

The no-arg method uses Locale.getDefault() internally. On an Android device, this uses the currently active Locale. If the currently active locale happens to be Turkish, then uppercase "I" becomes a non-ASCII unicode character 'LATIN SMALL LETTER DOTLESS I'.

This specifically manifested as the header X-Goog-Encode-Response-If-Executable being rejected by the okhttp library because it contained the non-ASCII character.

NOTE: this commit was originally written by @stuartfehr

The no-arg method uses Locale.getDefault() internally. On an Android device, this uses the currently active Locale. If the currently active locale happens to be Turkish, then uppercase "I" becomes a non-ASCII unicode character 'LATIN SMALL LETTER DOTLESS I'.

This specifically manifested as the header X-Goog-Encode-Response-If-Executable being rejected by the okhttp library because it contained the non-ASCII character.

NOTE: this commit was originally written by @stuartfehr
@jeanbza jeanbza requested a review from a team July 10, 2018 03:15
@jeanbza
Copy link
Member Author

jeanbza commented Jul 10, 2018

(I'll hold off on merging this in until we have finished the release that is in progress)

@chingor13 chingor13 added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Jul 19, 2018
@jeanbza jeanbza removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Aug 2, 2018
@chingor13 chingor13 merged commit d2cc4ca into googleapis:dev Aug 2, 2018
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Jan 15, 2021
By default `toLowerCase` uses the device's Locale, which could have unexpected
consequences on non-en_US locales.

See also
googleapis/google-http-java-client#420 (comment).

Differential Revision: https://phabricator.services.mozilla.com/D101822
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Jan 16, 2021
By default `toLowerCase` uses the device's Locale, which could have unexpected
consequences on non-en_US locales.

See also
googleapis/google-http-java-client#420 (comment).

Differential Revision: https://phabricator.services.mozilla.com/D101822

UltraBlame original commit: 349adceeb04a891d857c07fdbe711c5f4202a42e
clundin25 pushed a commit to clundin25/google-http-java-client that referenced this pull request Aug 11, 2022
…gleapis#420)

* feat: add TokenVerifier class that can verify RS256/ES256 tokens

* test: inject HttpTransportFactory for testing

* test: inject HttpTransportFactory for testing

* fix: use google-http-client for actual signature verification

* chore: lint

* test: split test into unit and integration

Unit tests mock out the http request activity. Integration tests hit the
live urls.

* chore: lint

* fix: return the JsonWebSignature instance on verify

* test: remove IT test as the signature keys can/will change over time

* docs: add javadoc for TokenVerifier

* docs: add guide for verifying tokens in the README

* chore: remove auto-value config changes

* chore: tense, lower-case first word, no period

* chore: run formatter

* chore: more javadoc fixes

* chore: remove line from README example

* sample: add snippet showing check for additional claim

* fix: remove default constructor - users should always use builder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants