[GH-ISSUE #624] Add URL encoding to search #364

Closed
opened 2026-02-28 14:32:29 +03:00 by kerem · 6 comments
Owner

Originally created by @SO9010 on GitHub (Jun 9, 2025).
Original GitHub issue: https://github.com/jpochyla/psst/issues/624

Currently, we are just using a placeholder to replace the spaces in a query but it needs to changed to use URL encoding.

Originally created by @SO9010 on GitHub (Jun 9, 2025). Original GitHub issue: https://github.com/jpochyla/psst/issues/624 Currently, we are just using a placeholder to replace the spaces in a query but it needs to changed to use URL encoding.
kerem 2026-02-28 14:32:29 +03:00
Author
Owner

@arch-btw commented on GitHub (Jun 11, 2025):

Hmm, do you mean that this line needs to be improved upon, or are you referring to something else?

github.com/jpochyla/psst@0e9c8d0283/psst-gui/src/webapi/client.rs (L1351)

<!-- gh-comment-id:2963688947 --> @arch-btw commented on GitHub (Jun 11, 2025): Hmm, do you mean that this line needs to be improved upon, or are you referring to something else? https://github.com/jpochyla/psst/blob/0e9c8d0283ced2c453aafa836be16de9fd51e48c/psst-gui/src/webapi/client.rs#L1351
Author
Owner

@SO9010 commented on GitHub (Jun 11, 2025):

Yeah that line!

<!-- gh-comment-id:2964032717 --> @SO9010 commented on GitHub (Jun 11, 2025): Yeah that line!
Author
Owner

@secondlnl commented on GitHub (Jun 12, 2025):

Sorry for probably being slow, but why does it need improving.

<!-- gh-comment-id:2965966323 --> @secondlnl commented on GitHub (Jun 12, 2025): Sorry for probably being slow, but why does it need improving.
Author
Owner

@SO9010 commented on GitHub (Jun 12, 2025):

I believe that if we don't do url encoding then we will get errors from illegal characters in urls. Which is why we needed to replace the spaces with %20. But I believe that we also need to do things like ':'.

But it was just a quick submitted issue that I didn't 100 percent check.

So if you would like to you could check if a query with something like : or any other not allowed chars in a url please feel free to do so. If not I'll be able to test soon :)

<!-- gh-comment-id:2966062654 --> @SO9010 commented on GitHub (Jun 12, 2025): I believe that if we don't do url encoding then we will get errors from illegal characters in urls. Which is why we needed to replace the spaces with %20. But I believe that we also need to do things like ':'. But it was just a quick submitted issue that I didn't 100 percent check. So if you would like to you could check if a query with something like : or any other not allowed chars in a url please feel free to do so. If not I'll be able to test soon :)
Author
Owner

@secondlnl commented on GitHub (Jun 12, 2025):

Edit: There exists a crate called urlencoding, link to docs.rs, rust discourse discussion about urlencoding in general
Tested:
Invalid uri
" < >
Status 400
# ` \ | % & { } + ^ ; €
The plus symbol is okay as long as there's another character, errors only when alone.
Others tested:
! @ £ $ ¤ / ( ) [ ] = ? ´ ¨ ~ * ' : . , _ - µ

<!-- gh-comment-id:2966336601 --> @secondlnl commented on GitHub (Jun 12, 2025): Edit: There exists a [crate called urlencoding, link to docs.rs](https://docs.rs/urlencoding/latest/urlencoding/), [rust discourse discussion about urlencoding in general](https://users.rust-lang.org/t/encode-decode-uri/90017/3) Tested: Invalid uri " < > Status 400 \# ` \ | % & { } + ^ ; € The plus symbol is okay as long as there's another character, errors only when alone. Others tested: ! @ £ $ ¤ / ( ) [ ] = ? ´ ¨ ~ * ' : . , _ - µ
Author
Owner

@SO9010 commented on GitHub (Jun 12, 2025):

Wow thank you very much! For the detailed test!
And that crate sounds good to me!

<!-- gh-comment-id:2966429383 --> @SO9010 commented on GitHub (Jun 12, 2025): Wow thank you very much! For the detailed test! And that crate sounds good to me!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/psst#364
No description provided.