URI manipulation advice
raj-blis opened this issue · comments
Hello,
Is it possible to do URL manipulation using the uriparser library - e.g. removing fragments OR removing certain query parameters?
Any advice would be much useful.
Thanks!
Hi @raj-blis, definitely possible, yes. I would recommend to:
- check https://uriparser.github.io/doc/api/latest/structUriUriStructA.html
- use LeakSanitizer/AddressSanitizer to be sure that your modifications are free of memory leaks and bad memory access
Hi @hartwork ,
Thanks for the response.
For e.g. if you have to remove the fragment, there is no API to free individual members of UriUriStructA. The only available method for clearing is uriFreeUriMembersA which deletes all members.
Could you please advice on how to achieve this (may be point to an example)?
Thanks!
@raj-blis all you need is linked lists, malloc, free, re-wiring pointers, plain C. In some sense uriparser leaves the "easy but annoying" bits to you compared to things like parsing and URI resolution. I can offer we jump on a ~30 minutes Jitsi call (https://meet.jit.si/) if you get stuck (my e-mail is on my profile page), but that's all I can offer here at the moment.