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

500 on base64 query #3522

Closed
Seluj78 opened this issue Feb 7, 2024 · 5 comments
Closed

500 on base64 query #3522

Seluj78 opened this issue Feb 7, 2024 · 5 comments
Assignees

Comments

@Seluj78
Copy link

Seluj78 commented Feb 7, 2024

Description

I was trying to make a filtered query and got a 500 when doing this query

GET https://shellhub.example.com/api/devices?page=1&per_page=100&filter=W3sidHlwZSI6InByb3BlcnR5IiwicGFyYW1zIjp7Im5hbWUiOiJuYW1lIiwib3BlcmF0b3IiOiJjb250YWlucyIsInZhbHVlIjoidCJ9fV0

No clue why, as I just copied the base64 from the UI when searching for the letter t in the search bar

Edition

Community

Version

0.14.1

@henrybarreto
Copy link
Member

henrybarreto commented Feb 7, 2024

Hi, @Seluj78.

This problem seems to be caused by a base64 decode error. Investigating it, I have noticed that the resultant request from typing t on our UI search bar is different by a char, = ,on its end.

Something like this, should work.

 http -v -A bearer -a "$token" GET http://localhost/api/devices\?page\=1\&per_page\=100\&filter\=W3sidHlwZSI6InByb3BlcnR5IiwicGFyYW1zIjp7Im5hbWUiOiJuYW1lIiwib3BlcmF0b3IiOiJjb250YWlucyIsInZhbHVlIjoidCJ9fV0\=

@Seluj78
Copy link
Author

Seluj78 commented Feb 7, 2024

Right, I just tested again and indeed it seems like I forgot to copy a =... My bad!

On the other end though, I think a more explicit message and something other than a 500 would benefit greatly the API users :)

@henrybarreto
Copy link
Member

I strongly agree. We are planning to work on the messages as soon as possible.

@Seluj78
Copy link
Author

Seluj78 commented Feb 7, 2024

Great, do you want me to open another issue/feature request about this message for you to track it ?

@henrybarreto
Copy link
Member

Perfect. It sounds good to me.

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

No branches or pull requests

2 participants