unioslo / harborapi

Python async client for the Harbor REST API v2.0.
https://unioslo.github.io/harborapi/
MIT License
28 stars 6 forks source link

Bug when passing in multiple `sort` and/or `query` fields separated by comma #29

Closed pederhan closed 1 year ago

pederhan commented 1 year ago

This was uncovered by https://github.com/pederhan/harbor-cli/issues/34.

This happens due to the way pagination headers are parsed:

https://github.com/pederhan/harborapi/blob/27900ab5e98c6dc2b7dbb04212414f4edc8d988e/harborapi/utils.py#L203-L210

If we are parsing a URL that has been urldecoded and we have a comma in the path - that will trigger the split, and thus the resulting URL will be malformed. Need to check out if there is a pagination standard, and see if we can find a library/snippet to do this for us, so we don't have to hand-roll this kind of logic.

pederhan commented 1 year ago

Fixed by e54808ff0a6b098285283a8375bd73223dd4f6b3.