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

Add leading slash to URL Path in getBaseUrlString function, if one does not already exist #14

Merged
merged 1 commit into from
Aug 22, 2024

Conversation

dacohen
Copy link
Contributor

@dacohen dacohen commented Aug 22, 2024

PR checklist

  • An issue/feature request has been created for this PR
  • Pull Request title clearly describes the work in the pull request and the Pull Request description provides details about how to validate the work. Missing information here may result in a delayed response.
  • File the PR against the master branch
  • The code in this PR is covered by unit tests

Link to issue/feature request: #13

Description

When the URL path doesn't have a leading slash, for example, when using the JoinPath function, getBaseUrlString does not correctly concatenate the host and path components. This is handled correctly in the stdlib net/url package, for example, when calling url.String().

This MR adds a similar check to the one used in net/url, to correctly handle this scenario.

Copy link

sonarcloud bot commented Aug 22, 2024

@karen-avetisyan-mc karen-avetisyan-mc self-requested a review August 22, 2024 15:46
Copy link
Contributor

@karen-avetisyan-mc karen-avetisyan-mc left a comment

Choose a reason for hiding this comment

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

LGTM

@karen-avetisyan-mc karen-avetisyan-mc added the safe The PR has been reviewed by Mastercard and has been validated to be safe label Aug 22, 2024
@karen-avetisyan-mc karen-avetisyan-mc merged commit 2a6b283 into Mastercard:main Aug 22, 2024
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
safe The PR has been reviewed by Mastercard and has been validated to be safe
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants