-
-
Notifications
You must be signed in to change notification settings - Fork 563
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
Simple fix to handle trailing slashs by parsing the server address. #979
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Nice, yeah I like the idea of a proper URL type. Looking at the docs though I was a bit confused at what I looked at some work code and it seems we use |
Another thought, don't want to put too much burden on you, but maybe we can parse the URL in the settings and pass that into these functions, rather than parse it every time. Not a huge concern, but it would be a little neater |
No, thats quite alright. I dont mind. So you are thinking that the the functions, should take the URL type as argument, and do the parsing once, when the config parameter is parsed? |
According to url docs
You'll get: (triple slash!)
I'm not a Rust programmer and don't know if there may be another library which does proper handling of this issue, however I think the sanest option would be to build up all end points from a base URL and not try to join partial paths. Anyway, atuin server configuration just receives a port, why would you have the server running on a more complicated path than "http://some-server:some-port/" ? Sorry if I sound like I don't know what I'm talking about (I don't :P ) , but got bitten by this bug today and just wanted to point out that |
I perused all Also the idea that an url in a string could come from a foreign source, and thus not be correct, is something not to be found in I thought I could fix the issue as this is low hanging fruit, but as I stated, I'm not a Rust programmer, and couldn't come with a solution (got too many complaints from the compiler). But I'd like to share the approach I tried, which only failed because my lack of Rust knowledge.
Inside it: Use I didn't search the whole code base, but from what I get from
All constructed end-points are just a Anyway, sorry for the noise and I hope to have contributed in some way. |
Hey! I'm not really too sure on the state of this one right now (it's been a while, sorry!), but would it be possible to do the same for the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll merge as-is for now
Thank you! |
Fixes the trailing slash reported in #389.