Skip to content

Comments

fix: use full endpoint in api requests#292

Open
fztgreen-veteransunited wants to merge 6 commits intomia-platform:mainfrom
fztgreen-veteransunited:fix/use-full-endpoint
Open

fix: use full endpoint in api requests#292
fztgreen-veteransunited wants to merge 6 commits intomia-platform:mainfrom
fztgreen-veteransunited:fix/use-full-endpoint

Conversation

@fztgreen-veteransunited
Copy link
Contributor

What this PR is for?

This PR fixes a bug where any path prefix set in the --endpoint configuration was silently discarded when building
request URLs.

When a user configured an endpoint with a path prefix (e.g. http://api-gateway/mia/), the prefix was stored correctly
in the config, but Request.URL() overwrote the full base path with the API path instead of appending to it:

// before
url.Path = r.apiPath

// after
url.Path = path.Join(url.Path, r.apiPath)

This caused all requests to be sent to the root of the host, ignoring the prefix entirely. For example, a project list
request with endpoint http://gateway/mia/ would go to http://gateway/api/backend/projects/ instead of
http://gateway/mia/api/backend/projects/.

@fztgreen-veteransunited fztgreen-veteransunited requested a review from a team as a code owner February 22, 2026 04:35
@fztgreen-veteransunited
Copy link
Contributor Author

Is this something we can support? It seems like a fairly large change to allow the full endpoint to be used in the api requests.

@ThisIsDemetrio
Copy link
Contributor

Is this something we can support? It seems like a fairly large change to allow the full endpoint to be used in the api requests.

It is definitely an important change, but still a bugfix. It makes sense to me to use the complete endpoint instead of parsing the baseUrl without the chance to include it.

Thanks for the proposed update. I'll start an internal review and - if everything is ok - we will merge this PR in a few days.

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