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
23
23
{
24
24
$ name = 'World ' ;
25
25
$ body = $ request ->getBody ()->getContents ();
26
- switch ($ request ->getHeader ('content-type ' )[ 0 ] ) {
26
+ switch ($ request ->getHeaderLine ('content-type ' )) {
27
27
// '{"name":"John"}'
28
28
case 'application/json ' :
29
29
if (!empty ($ body )) {
Original file line number Diff line number Diff line change @@ -31,13 +31,10 @@ function isValidSlackWebhook(ServerRequestInterface $request): bool
31
31
$ SLACK_SECRET = getenv ('SLACK_SECRET ' );
32
32
33
33
// 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 ' );
36
36
if (!$ timestamp || !$ signature ) {
37
37
return false ;
38
- } else {
39
- $ timestamp = $ timestamp [0 ];
40
- $ signature = $ signature [0 ];
41
38
}
42
39
43
40
// Compute signature
You can’t perform that action at this time.
0 commit comments