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

GET /published/ route is inconsistent when specifying invalid parameters #10561

Open
dcermak opened this issue Dec 16, 2020 · 3 comments
Open
Labels
Backend Things regarding the OBS backend Bug

Comments

@dcermak
Copy link
Contributor

dcermak commented Dec 16, 2020

Issue Description

The GET /published/ route is relatively inconsistent when one specifies invalid parameters.

For example osc api /published/Virtualization:vagrant/ succeeds and osc api /published/Virtualization:vagrant:invalid/ is rejected with a 404. But, once you get into subdirectories, this no longer applies as osc api /published/Virtualization:vagrant/openSUSE_Tumbleweed results in a list of directories, but osc api /published/Virtualization:vagrant/this_does_not_exist just gives me an empty directory.

Expected Result

Specifying invalid parameters should either result in a 404 for all parameters or none of them.

Further Information

  • tested against build.opensuse.org
@dcermak
Copy link
Contributor Author

dcermak commented Dec 17, 2020

I've realized that it gets even more inconsistent once you start adding more path entries:

$ osc api /published/Virtualization:vagrant/this_does_not_exist
<directory>
</directory>
$ osc api /published/Virtualization:vagrant/this_does_not_exist/foo
<directory>
</directory>
$ osc api /published/Virtualization:vagrant/this_does_not_exist/foo/bar
Server returned an error: HTTP Error 404: no such file
no such file
$ osc api /published/Virtualization:vagrant/this_does_not_exist/foo/bar/baz
Server returned an error: HTTP Error 404: Not Found

I would suggest to start throwing 404s immediately, as the current behavior makes wrapping the API rather awkward.

@danidoni danidoni added Bug Frontend Things related to the OBS RoR app labels Dec 17, 2020
@dcermak
Copy link
Contributor Author

dcermak commented Dec 18, 2020

@danidoni afaik these routes go directly to the backend, so I guess that this is something for @mlschroe?

@danidoni
Copy link
Contributor

@danidoni afaik these routes go directly to the backend, so I guess that this is something for @mlschroe?

Ouch, true. Changing

@danidoni danidoni added Backend Things regarding the OBS backend and removed Frontend Things related to the OBS RoR app labels Dec 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backend Things regarding the OBS backend Bug
Projects
None yet
Development

No branches or pull requests

2 participants