Conversation
…l endpoints Signed-off-by: Jean-Baptiste Delon <jean-baptiste.delon@ovhcloud.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
fix(http): route legacy /v1 paths under /1.0 on non-official endpoints
go-ovh aliases "/v1/"-prefixed paths to the endpoint's bare domain root instead of appending them under its "/1.0" base — a trick that only works on the official ovh-eu/ovh-ca/ovh-us gateways. On every other endpoint (Kimsufi, SoYouStart, custom URLs), that alias 404s since those hosts only serve the API under "/1.0".
Wrap the go-ovh client so Get/Post/Put/Delete/NewRequest strip the leading "/v1" segment before the request is built and signed whenever the active endpoint isn't one of the 3 official ones, letting the path append under the endpoint's own "/1.0" base instead.
Adjust the scope/subject if you'd rather tie it to the symptom (e.g. fix(baremetal): fix Kimsufi/SoYouStart 404s on dedicated server calls), but since the fix lives entirely in internal/http/client.go and applies to every affected product (not just baremetal), fix(http) is more accurate.
Fixes #281
Type of change
Please delete options that are not relevant.
Checklist:
go mod tidy