-
Notifications
You must be signed in to change notification settings - Fork 13.3k
webserver: do not count "plain" in argument list #6768
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
Conversation
it is still available though
I think this could break things. If we're going to break things,we likely should go all the way and rethink this feature.
|
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 think the approach to handling the "plain" case should be revisited and improved. See my comment.
.. is the Content = the Payload of the http message. |
Things are currently broken and this PR hopefully fixes the situation:
This PR is useful when testing the number of args in POST requests, which seems to be done by issuers.
I totally agree with this. In the meantime, things need fixing. |
@d-a-v
What does arg(0) (argument at index 0) return when the first arg provided has no value
What does arg(0) (argument at index 0) return when no args were provided
|
I was previously thinking that I added It is anyway always not safe to rely on numbers and it is preferred to check presence of a variable name, then get its value, so nothing is dependent on arg counter. The only reason I can see about reading positional arguments is when one iterate over them to bravely parse a request, by looping from 0 to count-1, checking the name, and if it is recognized, getting its value to make something with it. In that case This has to be double checked
before : 0 (not POST) or 1 (POST)
before: when it is a POST it can return the request content (== |
Hi, @d-a-v , thanks for the explanation.
But what is your take on the following construct from a risk/performance/cleanliness point of view:
|
Sorry for the late response. Yes, that's better because there's only one search. |
Hi all, I tried to check for a step back on this but not found. |
"plain"
is implicit and is not a real url parameter.This PR will hide it from the argument counter, but
arg("plain")
is still available.fixes #6435
edit:
fixes #7106
#5252 added key
"plain"
to the list of arguments. Unfortunately as a side effect, this key is also always counted in the argument list. This PR removes this effect.