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

bug: metadata query param with : not being parsed correctly #1357

Closed
csmig opened this issue Aug 30, 2024 · 0 comments · Fixed by #1359
Closed

bug: metadata query param with : not being parsed correctly #1357

csmig opened this issue Aug 30, 2024 · 0 comments · Fixed by #1359
Assignees
Labels

Comments

@csmig
Copy link
Member

csmig commented Aug 30, 2024

GET endpoints which accept a metadata query parameter are not parsing that parameter correctly if the metadata value contains the colon character (:).

The API specification requires the metadata query parameter to be encoded as key:value. So if the key is cklWebDbSite and the value is 0.0.0.0:8080, the query parameter is encoded as cklWebDbSite:0.0.0.0:8080.

The API implementation handles the metadata query parameter like this:

const [key, value] = pair.split(':')

This will not correctly recover value if it contains a colon. For the example above, it returns the value only up to the colon (0.0.0.0).

Affected endpoints:

  • GET /collections
  • GET /assets
  • GET /collections/{collectionId}/reviews

The likely fix is to change the implementation to:

const [key, value] = pair.split(/:(.*)/s)
@csmig csmig added the API label Aug 30, 2024
@csmig csmig changed the title bug: metadata predicate value with : not being parsed correctly bug: metadata query param with : not being parsed correctly Aug 30, 2024
@csmig csmig self-assigned this Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant