-
-
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
[stable23] Make X-HAS-{MD5/SHA256} opt-in #32759
Conversation
This is not always needed and slow down the upload Signed-off-by: Carl Schwan <[email protected]> (cherry picked from commit 1b426ed)
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.
code looks good
if ($this->request->getHeader('X-HASH') !== '') { | ||
$hash = $this->request->getHeader('X-HASH'); | ||
if ($hash === 'all' || $hash === 'md5') { | ||
$data = HashWrapper::wrap($data, 'md5', function ($hash) { |
Check notice
Code scanning / Psalm
MissingClosureParamType
} | ||
|
||
if ($hash === 'all' || $hash === 'sha1') { | ||
$data = HashWrapper::wrap($data, 'sha1', function ($hash) { |
Check notice
Code scanning / Psalm
MissingClosureParamType
} | ||
|
||
if ($hash === 'all' || $hash === 'sha256') { | ||
$data = HashWrapper::wrap($data, 'sha256', function ($hash) { |
Check notice
Code scanning / Psalm
MissingClosureParamType
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 not always needed and slow down the upload
Signed-off-by: Carl Schwan [email protected]
(cherry picked from commit 1b426ed)