Make WordPress Core


Ignore:
Timestamp:
02/03/2023 01:33:18 PM (16 months ago)
Author:
audrasjb
Message:

HTTP API: Fix request header inconsistencies.

This changeset improves the consistency in capitalization of fetching and outputting of request headers. It also updates occurrences found in some docblocks.

Props johnjamesjacoby, costdev, audrasjb, petitphp, mhkuu, SergeyBiryukov.
Fixes #54225.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/http/functions.php

    r54997 r55210  
    2121        $this->assertIsArray( $response );
    2222
    23         $this->assertSame( 'image/jpeg', $headers['content-type'] );
    24         $this->assertSame( '40148', $headers['content-length'] );
     23        $this->assertSame( 'image/jpeg', $headers['Content-Type'] );
     24        $this->assertSame( '40148', $headers['Content-Length'] );
    2525        $this->assertSame( 200, wp_remote_retrieve_response_code( $response ) );
    2626    }
     
    6666
    6767        // Should return the same headers as a HEAD request.
    68         $this->assertSame( 'image/jpeg', $headers['content-type'] );
    69         $this->assertSame( '40148', $headers['content-length'] );
     68        $this->assertSame( 'image/jpeg', $headers['Content-Type'] );
     69        $this->assertSame( '40148', $headers['Content-Length'] );
    7070        $this->assertSame( 200, wp_remote_retrieve_response_code( $response ) );
    7171    }
     
    8787
    8888        // Should return the same headers as a HEAD request.
    89         $this->assertSame( 'image/jpeg', $headers['content-type'] );
    90         $this->assertSame( '40148', $headers['content-length'] );
     89        $this->assertSame( 'image/jpeg', $headers['Content-Type'] );
     90        $this->assertSame( '40148', $headers['Content-Length'] );
    9191        $this->assertSame( 200, wp_remote_retrieve_response_code( $response ) );
    9292    }
Note: See TracChangeset for help on using the changeset viewer.