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

Fix sentry-tower URL generation #460

Merged
merged 2 commits into from
May 3, 2022

Conversation

pbzweihander
Copy link
Contributor

@pbzweihander pbzweihander commented May 3, 2022

request.uri() may contains only relative URI (e.g. /foo/bar), but Url::parse requires full URL with base (e.g. http://localhost/foo/bar). So request.uri().to_string().parse() can fail.

This PR adds a fixed http:// scheme if the scheme does not exist and a host from the host header if the authority does not exist before parsing the URL.


By submitting this pull request, I confirm that Sentry can use, modify, copy, and redistribute this contribution, under Sentry's choice of terms.

@codecov-commenter
Copy link

Codecov Report

Merging #460 (b6fae75) into master (2243fa5) will decrease coverage by 0.08%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master     #460      +/-   ##
==========================================
- Coverage   80.28%   80.19%   -0.09%     
==========================================
  Files          73       73              
  Lines        8389     8398       +9     
==========================================
  Hits         6735     6735              
- Misses       1654     1663       +9     

@Swatinem Swatinem merged commit 53a81d5 into getsentry:master May 3, 2022
@pbzweihander pbzweihander deleted the sentry-tower-url branch May 3, 2022 08:20
@pbzweihander pbzweihander restored the sentry-tower-url branch May 13, 2022 07:56
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.

3 participants