Making WordPress.org


Ignore:
Timestamp:
03/11/2021 05:36:27 AM (4 years ago)
Author:
dd32
Message:

Trac: Github PRs: Throw a warning early when the webhook is setup incorrectly.

This avoids warnings and should be flagged in the Github UI.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/api.wordpress.org/public_html/dotorg/trac/pr/webhook.php

    r10736 r10809  
    2626
    2727verify_signature();
     28
     29if ( empty( $_SERVER['CONTENT_TYPE'] ) || 'application/json' !== $_SERVER['CONTENT_TYPE'] ) {
     30    header( 'HTTP/1.0 400 Bad Request', true, 400 );
     31    die( 'Please set the Content type to application/json' );
     32}
    2833
    2934$payload = json_decode( file_get_contents( 'php://input' ) );
Note: See TracChangeset for help on using the changeset viewer.