File tree Expand file tree Collapse file tree 2 files changed +3
-6
lines changed
Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ function helloContent(ServerRequestInterface $request): string
2323{
2424 $ name = 'World ' ;
2525 $ body = $ request ->getBody ()->getContents ();
26- switch ($ request ->getHeader ('content-type ' )[ 0 ] ) {
26+ switch ($ request ->getHeaderLine ('content-type ' )) {
2727 // '{"name":"John"}'
2828 case 'application/json ' :
2929 if (!empty ($ body )) {
Original file line number Diff line number Diff line change @@ -31,13 +31,10 @@ function isValidSlackWebhook(ServerRequestInterface $request): bool
3131 $ SLACK_SECRET = getenv ('SLACK_SECRET ' );
3232
3333 // Check for headers
34- $ timestamp = $ request ->getHeader ('X-Slack-Request-Timestamp ' );
35- $ signature = $ request ->getHeader ('X-Slack-Signature ' );
34+ $ timestamp = $ request ->getHeaderLine ('X-Slack-Request-Timestamp ' );
35+ $ signature = $ request ->getHeaderLine ('X-Slack-Signature ' );
3636 if (!$ timestamp || !$ signature ) {
3737 return false ;
38- } else {
39- $ timestamp = $ timestamp [0 ];
40- $ signature = $ signature [0 ];
4138 }
4239
4340 // Compute signature
You can’t perform that action at this time.
0 commit comments