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(apps/hermes/client): allow baseURL with suffixes #1728

Merged
merged 3 commits into from
Jun 25, 2024

Conversation

mubaris
Copy link
Contributor

@mubaris mubaris commented Jun 24, 2024

No description provided.

Copy link

vercel bot commented Jun 24, 2024

@mubaris is attempting to deploy a commit to the pyth-web Team on Vercel.

A member of the Team first needs to authorize it.

@mubaris mubaris changed the title fix(apps/hermes/client): allow baseURL with prefixes fix(apps/hermes/client): allow baseURL with suffixes Jun 24, 2024
@@ -100,7 +100,7 @@ export class HermesClient {
query?: string;
filter?: string;
}): Promise<PriceFeedMetadata[]> {
const url = new URL("/v2/price_feeds", this.baseURL);
const url = new URL(`${this.baseURL}/v2/price_feeds`);
Copy link
Contributor

@cctdaniel cctdaniel Jun 25, 2024

Choose a reason for hiding this comment

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

I think we should keep the current structure but make the path relative e.g.

const url = new URL('v2/price_feeds', baseURL);

The URL constructor ensures that the protocol and host parts of the base URL are preserved correctly, even if the base URL has additional path components.

If you could also make the changes for getLatestPriceUpdates and getPriceUpdatesAtTimestamp that would be appreciated!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Have updated it

Copy link
Contributor

@cctdaniel cctdaniel left a comment

Choose a reason for hiding this comment

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

Thanks for catching the bug and opening a PR, left a comment and happy to look again once that's addressed.

@cctdaniel
Copy link
Contributor

thanks for your contribution! can you bump the package version?

@mubaris
Copy link
Contributor Author

mubaris commented Jun 25, 2024

done!

Copy link

vercel bot commented Jun 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
xc-admin-frontend ⬜️ Ignored (Inspect) Visit Preview Jun 25, 2024 10:12am

@cctdaniel cctdaniel merged commit dcf7a31 into pyth-network:main Jun 25, 2024
3 of 5 checks passed
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