-
-
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
fix(Http): Only allow valid HTTP status code values via template #49882
Conversation
b7691e8
to
98b1635
Compare
"type": "string", | ||
"enum": [ | ||
"attachment; filename=\"nextcloud.log\"" | ||
] |
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.
Should that be part of API definition 🤔
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 ignored it before, but with these changes psalm is very unhappy somehow.
IMO the proper fix would be to ignore this header completely in openapi-extractor.
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.
Not sure, would at least be good for devices to know if a file name is given, etc?
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.
Yes, although on the other hand I don't know how much sense it makes to specify the value that will be returned. Just saying that a string is returned should be good enough, the clients need to parse that anyway.
@@ -7,16 +7,18 @@ | |||
*/ | |||
namespace OCP\AppFramework\Http; | |||
|
|||
use OCP\AppFramework\Http; |
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.
didnt this explode on some version of PHP because you can not import a class with the same name as a namespace?
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 never heard of that problem before and CI is green, so I don't think it's a problem here?
Signed-off-by: provokateurin <[email protected]>
Signed-off-by: provokateurin <[email protected]>
98b1635
to
7db694f
Compare
/backport to stable30 |
/backport to stable29 |
/backport to stable28 |
Summary
To prevent anyone from using invalid HTTP status codes.
Ideally it would be possible to re-use the
S
and so on template parameters when extending the parent templates, but psalm doesn't seem to support that.Checklist