Making WordPress.org

Changeset 10060


Ignore:
Timestamp:
07/11/2020 12:38:56 AM (6 years ago)
Author:
dd32
Message:

Main: Add Canonical and proper Content-Type headers to the download counter ajax endpoints.

Props joostdevalk.
Fixes #5315.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-main/page-download-counter.php

    r9780 r10060  
    3232
    3333if ( ! empty( $_GET['ajaxupdate'] ) ) {
     34        header( 'Link: <' . $canonical_url  . '>; rel="canonical"' );
     35
    3436        die( esc_html( number_format_i18n( $num ) ) );
    3537}
    3638
    3739if ( ! empty( $_GET['json'] ) ) {
     40        header( 'Content-Type: application/json' );
     41        header( 'Link: <' . $canonical_url  . '>; rel="canonical"' );
     42
    3843        ?>
    3944        {"wpcounter": {
Note: See TracChangeset for help on using the changeset viewer.