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(superagent-wrapper): support non-/ api base paths #380

Merged
merged 1 commit into from Jan 18, 2023

Conversation

bitgopatmcl
Copy link
Contributor

This should fix #337. I initially tried to use an alternate URL constructor like:

const url = new URL(substitutedPath, basePath);

and was surprised to learn that this actually has the exact same behavior of stripping the base path. It seems like it should be possible to make the substituted path a relative one, but that has issues as well.

Ultimately I pulled in posix.join from path. This works, but may potentially introduce issues with some web bundlers if they don't provide an implementation of Node's path module.

@bitgopatmcl bitgopatmcl requested a review from a team as a code owner January 18, 2023 15:42
Copy link
Contributor

@ericcrosson-bitgo ericcrosson-bitgo left a comment

Choose a reason for hiding this comment

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

Preserves the base url after path-param substitution 🚀

@ericcrosson-bitgo ericcrosson-bitgo merged commit 2bb688f into BitGo:master Jan 18, 2023
@github-actions
Copy link

🎉 This PR is included in version @api-ts/express-wrapper@1.0.12 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

@github-actions
Copy link

🎉 This PR is included in version @api-ts/superagent-wrapper@1.1.7 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

@github-actions
Copy link

🎉 This PR is included in version @api-ts/typed-express-router@1.0.9 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

@github-actions
Copy link

🎉 This PR is included in version @api-ts/io-ts-http@2.1.0 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

@github-actions
Copy link

🎉 This PR is included in version @api-ts/response@2.0.0 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

@github-actions
Copy link

🎉 This PR is included in version @api-ts/openapi-generator@1.0.6 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Base path is lost when replacing path params
2 participants