-
Notifications
You must be signed in to change notification settings - Fork 0
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
#92 url parameters meegeven #93
Conversation
urihandler/handler.py
Outdated
@@ -37,7 +37,8 @@ def handle(self, uri, request): | |||
redirect = self._get_redirect_based_on_accept_header( | |||
request.accept, redirect | |||
) | |||
redirect = redirect.format(**m.groupdict()) | |||
unmatched_part = (uri.replace(m.group(), "")) | |||
redirect = redirect.format(**m.groupdict()) + unmatched_part |
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.
Ik zou gwn request.query_string
gebruiken ipv unmatched part. Het ?
zit er wel niet bij.
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.
dat is leeg bij mij, de query paramaters zijn onderdeel van de bevraagde uri, geen echte query paramaters
nvm verkeerde test
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.
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.
ahhh right, by die andere APIs wel ja. Ik had enkel de redirect
route getest.
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.
denk dat die params wel altijd best url encoded doorkomen dat het als onderdeel wordt gezien vd uri anders werkt het niet
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.
In de praktijk zijn alle urls wel gedefinieert met $
achteraan. Dus de match zal falen daarmee.
https://github.com/OnroerendErfgoed/scripts/blob/master/servers/joeri/config/urihandler.yaml
De queryparams zullen eraf moeten voor de match. Ik denk dat simpele string manipulatie wel ok is. Gewoon alles na het eerste vraagteken eraf, en bijhouden om er later terug aan te plakken.
0bfbac8
to
743e02e
Compare
Dit werkt in de simpele test case, maar is dit robuust/veilig genoeg ?