Allow creation of temporary environment using custom-url with empty fragment#487
Merged
philip-maina merged 1 commit intomasterfrom Aug 16, 2023
Merged
Conversation
Contributor
Author
runner_test.go
Outdated
Comment on lines
+285
to
+286
| if customURLParam != "" { | ||
| if client.temporaryEnvironmentURL != customURLParam { |
Contributor
There was a problem hiding this comment.
I guess you could also reduce the nesting by putting these 2 if into 1 and use && ?
Contributor
sebaherrera07
left a comment
There was a problem hiding this comment.
Looks good to me. Did you try this change yourself locally?
Just to be sure that it works as expected.
magni-
approved these changes
Aug 16, 2023
runner.go
Outdated
|
|
||
| var environment *rainforest.Environment | ||
| environment, err = r.client.CreateTemporaryEnvironment(description, customURL.String(), webhookURL.String()) | ||
| environment, err = r.client.CreateTemporaryEnvironment(description, customURLParam, webhookURL.String()) |
Contributor
There was a problem hiding this comment.
Should we also use webhookParam here, since that could be susceptible to the same issue?
f8ddca8 to
4c003ef
Compare
Contributor
Author
…y fragment. Previously, if you passed a custom-url with an empty fragment e.g https://example.com# the empty fragment would be stripped of and a temporary environment with url https://example.com would be created. This change ensures that empty fragments are retained.
4c003ef to
1212393
Compare
Contributor
|
@philip-maina Worth a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
Prior to this PR, if you passed a
custom-urlwith an empty fragment e.ghttps://example.com#the#would be stripped off and a temporary environment with urlhttps://example.comwould be created instead.This happens because we parse the
custom-url(see here) and parsing urls like sourl.Parse(myUrl)in golang has a known issue.The fix implemented ensures that
#is retained in the url even if the fragment is empty.Related issue: #473