Skip to content

fix: remove trailing slash from url#103

Merged
craicoverflow merged 1 commit intomasterfrom
parse-url
Dec 1, 2020
Merged

fix: remove trailing slash from url#103
craicoverflow merged 1 commit intomasterfrom
parse-url

Conversation

@craicoverflow
Copy link
Contributor

cc @wtrocki

This PR sanitizes the input URL and removes trailing slashes.

See https://golang.org/pkg/path/#Clean

@craicoverflow craicoverflow requested a review from wtrocki December 1, 2020 15:12
gatewayURL, ok := urlAliases[args.url]
if !ok {
gatewayURL = args.url
gatewayURL = path.Clean(args.url)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this work in windows?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, it is a web URL, I would think the desktop environment does not matter here?

@craicoverflow craicoverflow merged commit 1aa3ad3 into master Dec 1, 2020
@craicoverflow craicoverflow deleted the parse-url branch December 1, 2020 16:40
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.

2 participants