-
Notifications
You must be signed in to change notification settings - Fork 541
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: host URL for instances in different regions #4374
Conversation
4bda823
to
1b8a5f7
Compare
src/lib/config/api-url.ts
Outdated
// given an api url that starts with api means, that we can replace "api" by "app". | ||
|
||
const apiUrl = new URL(apiUrlString); | ||
apiUrl.host = apiUrl.host.replace(/^api\./, 'app.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about https://snyk.io/api
? That should become https://app.xx.snyk.io/api, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess, what I want to say is that you don't always have an api
subdomain ;).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely correct, we might not have "api" sub-domains which is fine, they remain unaltered. As far as I understood, https://snyk.io/api
is the legacy, still supported url.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After discussing with @bastiandoetsch offline, we decided to reduce the impact of the change a bit, by replacing "api." by an empty string only, not replacing by "app.". Which is basically what was there before just that we keep Urls that have "app." already unaltered.
1b8a5f7
to
4667d6c
Compare
What does this PR do?
Previously we assumed that the root hostname shouldn't start with "app." but this is actually the consistent endpoint for cross region usage.