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

api: allow parameters with urlencoded names #1079

Merged
merged 1 commit into from
Jun 15, 2022

Conversation

sjoerdsimons
Copy link
Contributor

Aptly allows create e.g. repos with a / to use those with the REST api
the router needs to allow urlencoded parameters in various places to
represent this. A specific example of this is the /api/repos/:name/packages path

Signed-off-by: Sjoerd Simons sjoerd@collabora.com

Aptly allows create e.g. repos with a / to use those with the REST api
the router needs to allow urlencoded parameters in various places to
represent this. A specific example of this is the /api/repos/:name/packages path

Signed-off-by: Sjoerd Simons <sjoerd@collabora.com>
@randombenj
Copy link
Contributor

So this allows to have urlencoded / in the :name variable in for example /api/repos/:name/packages?

@sjoerdsimons
Copy link
Contributor Author

So this allows to have urlencoded / in the :name variable in for example /api/repos/:name/packages?

Yup exactly we ended up with some repos called "badger/snake" with this change you can GET /api/repos/badger%2Fsnakes/packages, without it gin will treat it the same as /api/repos/badger/snakes/packages and thus error out

@randombenj randombenj self-requested a review June 15, 2022 15:20
@randombenj randombenj merged commit 29deae6 into aptly-dev:master Jun 15, 2022
@randombenj randombenj added this to the 1.5.0 milestone Jun 23, 2022
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