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

worker: remove api.BasePath and replace with MakeHTTPErrorHandler() #4330

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mvo5
Copy link
Contributor

@mvo5 mvo5 commented Aug 26, 2024

[draft as it currently has no tests :( ]

The api.BasePath is package global but the way it is used is that multiple clients can (potentially) have different BasePath and the way it is written right now could lead to confusing bugs.

This commit tweaks the api package so that BasePath does not need to be set. The only place that this is needed is for the api.APIError() which can just get the basePath as an argument. With that we also need a helper to construct the api error handler from the static HTTPErrorHandler to a dynamic MakeHTTPErrorHandler() that will return a handler for the given basePath.

This should make #4328 obsolete.

The `api.BasePath` is package global but the way it is used is that
multiple clients can (potentially) have different BasePath and
the way it is written right now could lead to confusing bugs.

This commit tweaks the `api` package so that `BasePath` does not
need to be set. The only place that this is needed is for the
`api.APIError()` which can just get the basePath as an argument.
With that we also need a helper to construct the api error handler
from the static HTTPErrorHandler to a dynamic MakeHTTPErrorHandler()
that will return a handler for the given basePath.

This should make osbuild#4328
obsolete.
Copy link

This PR is stale because it has been open 30 days with no activity. Remove "Stale" label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label Sep 26, 2024
Copy link

github-actions bot commented Oct 3, 2024

This PR was closed because it has been stalled for 30+7 days with no activity.

@github-actions github-actions bot closed this Oct 3, 2024
@mvo5 mvo5 reopened this Oct 7, 2024
@github-actions github-actions bot removed the Stale label Oct 8, 2024
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.

1 participant