Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Request::hasHeader('Host') returns false #172

@1ma

Description

@1ma

Here is a small script that reproduces the issue. It has been run on PHP 5.6 against the 1.3.5 version of the library.

<?php

require_once __DIR__.'/vendor/autoload.php';

$request = new \Zend\Diactoros\Request('http://example.com/foo', 'GET');

var_dump($request->hasHeader('host'));
var_dump($request->hasHeader('Host'));

var_dump($request->getHeader('host'));
var_dump($request->getHeader('Host'));

var_dump($request->getHeaders());

// bool(false)
// bool(false)
// array(1) {
//   [0] =>
//   string(11) "example.com"
// }
// array(1) {
//   [0] =>
//   string(11) "example.com"
// }
// array(1) {
//   'Host' =>
//   array(1) {
//     [0] =>
//     string(11) "example.com"
//   }
// }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions