-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
WebAPI: Allow to specify session cookie name #18384
Conversation
It may be useful to add a command line parameter (and/or an environment variable) to define the cookie name. |
Environment variable is unlikely to be useful since it will affect all the instances but this option is mostly to use different cookie name per instance. |
Prepending a single command with environment variable will take effect for that command only, for example, |
Ok. Thank you for explanation.
In any case, let's leave all this for future improvements, if there really is a need for them. |
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.
Token approval. I haven't tested this.
FYI, and since last time I checked, our "cmd options code" automatically creates an ENV lookup for each cmd option. I don't know if this has changed over the last year. |
It's the other way around. See |
if (cookieName.isEmpty() || (cookieName.size() > 128)) | ||
return false; | ||
|
||
const QRegularExpression invalidNameRegex {u"[^a-zA-Z0-9_\\-]"_qs}; |
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.
This is a very general remark and I don't know if this has been discussed already.
For regex we should consider switching to raw string literals. It will improve regex readability by dropping the need for backslash escapes.
However, I don't know if raw string literals can mix with user-defined literals (_qs
).
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 don't know if this has been discussed already.
For regex we should consider switching to raw string literals.
We didn't discuss such a requirement earlier.
It will improve regex readability by dropping the need for backslash escapes.
Personally, I don't care about it in trivial cases like this. In complex regexps, it really makes sense.
However, if you see the point of making this a requirement for regular expressions, I don't mind. But in this case, it would be good to start by converting all existing instances, so that later some newly-minted contributors do not poke their finger there when they are pointed out to such a requirement.
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 am not keen into make it a hard requirement. You should treat it more like a suggestion IMO.
Do you think it should be a requirement?
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.
Do you think it should be a requirement?
No.
Closes #18329.