Open OmentaElvis opened 1 month ago
I did some digging on the source code and found out this line defines a regex that is used to replace all existence of '?' followed by any character after that. This effectively treats all my regex after the first '?' as a beginning of query parameters.
let query_regex = Regex::new(r"\?.*").unwrap();
// then
let pattern = query_regex.replace(uri, "");
Should we like add an escape mechanism to signify to the create_uri_regex
to leave the argument as is since we already provided our own regex?
Or maybe clarify on the documentation that only certain symbols will pass the uri parameters parsing and other valid regex may not execute as expected.
I would suggest a different create_resource
function that accept regex as is without modifying it or a public set_uri_regex
for Resource.
I needed some complex path handling. I created this regex to handle my dynamic paths.
I tested the regex externally and it works as expected but the create_resource one panics with:
What i expected was to obtain the params by.
so the uri:
/com/example/my-module/maven-metadata.xml
should produce: group_id :
com.example
artifact_id:my-module