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

Be more strict about url scheme parsing #2343

Merged
merged 2 commits into from
Aug 21, 2022

Conversation

vanschelven
Copy link
Contributor

Pull Request check-list

Please make sure to review and check all of these items:

  • Does $ tox pass with this change (including linting)?
  • Do the CI tests pass with this change (enable it first in your forked repo and wait for the github action build to finish)?
  • Is the new or changed code fully tested?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Is there an example added to the examples folder (if applicable)?
  • Was the change added to CHANGES file?

NOTE: these things are not required to open a PR and can be done
afterwards / while the PR is open.

Description of change

The error message implied that urls had to start with scheme://.
However, if the double slash was left out, the url parsed just fine
and the part that was ostensibly intended to be the hostname ended
up as part of the path, whereas the default (localhost) would be
used for the hostname. This commit makes the check as strict as the
error message implies by including a check for the double slash.

@vanschelven vanschelven force-pushed the from-url-more-strict-schemes branch from ce40abf to e1cd85a Compare August 19, 2022 08:00
@vanschelven
Copy link
Contributor Author

I think the pipeline troubles are independent of this fix (see #2344)

The error message implied that urls had to start with `scheme://`.
However, if the double slash was left out, the url parsed just fine
and the part that was ostensibly intended to be the hostname ended
up as part of the path, whereas the default (localhost) would be
used for the hostname. This commit makes the check as strict as the
error message implies by including a check for the double slash.
@vanschelven vanschelven force-pushed the from-url-more-strict-schemes branch from e1cd85a to 9133039 Compare August 19, 2022 08:26
@codecov-commenter
Copy link

codecov-commenter commented Aug 21, 2022

Codecov Report

Merging #2343 (4b6d68e) into master (031b208) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #2343      +/-   ##
==========================================
+ Coverage   92.19%   92.20%   +0.01%     
==========================================
  Files         111      111              
  Lines       28777    28781       +4     
==========================================
+ Hits        26530    26537       +7     
+ Misses       2247     2244       -3     
Impacted Files Coverage Δ
redis/connection.py 86.90% <100.00%> (ø)
tests/test_connection_pool.py 100.00% <100.00%> (ø)
redis/asyncio/connection.py 86.11% <0.00%> (+0.11%) ⬆️
tests/test_cluster.py 96.96% <0.00%> (+0.11%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@dvora-h dvora-h added the maintenance Maintenance (CI, Releases, etc) label Aug 21, 2022
@dvora-h dvora-h merged commit b5ebada into redis:master Aug 21, 2022
@chayim chayim added bug Bug and removed maintenance Maintenance (CI, Releases, etc) labels Sep 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants