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

Trim leading slash on soap path #3201

Merged
merged 1 commit into from
Aug 10, 2023
Merged

Trim leading slash on soap path #3201

merged 1 commit into from
Aug 10, 2023

Conversation

rikatz
Copy link
Contributor

@rikatz rikatz commented Aug 3, 2023

Description

When passing an endpoint as https://some.vcenter.tld/ to govc (or soap client), it will consider the leading / as part of the path and not add the /sdk.

This leads to errors when consuming vCenter API.

While passing the leading "/" may be desired, I'm not sure if there's a better way to turn this error more intuitive.

This PR also adds some unit tests on ParseURL function

Closes: #(issue-number)

Type of change

Please mark options that are relevant:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to
    not work as expected)
  • This change requires a documentation update
  • Build related change

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce. If applicable, please also list any relevant
details for your test configuration.

  • Added unit tests
  • Tested soap.ParseURL with and without the change, and passing the URL as https://some.vcenter.tld with and without the leading path. Without the change, it always gets an unauthorized access

Checklist:

  • My code follows the CONTRIBUTION guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged

Copy link
Member

@dougm dougm left a comment

Choose a reason for hiding this comment

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

Thanks @rikatz , lgtm
Also added you to the team, you should be able to merge now w/ the approval

@rikatz
Copy link
Contributor Author

rikatz commented Aug 10, 2023

You don't want to give me this kind of powers Doug :P

Thanks!! Merging here!

@rikatz rikatz merged commit b504836 into vmware:main Aug 10, 2023
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants