Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Url::fromHttp() global state dependency #4

Open
AnrDaemon opened this issue Mar 4, 2020 · 0 comments
Open

Url::fromHttp() global state dependency #4

AnrDaemon opened this issue Mar 4, 2020 · 0 comments
Assignees

Comments

@AnrDaemon
Copy link
Owner

Url::fromHttp() rely on the $_SERVER superglobal variable to provide request information.

It should either receive the provider array as part of the arguments or rely on the filter_input_array(INPUT_SERVER) as being authoritative.

Perhaps, change signature to

function fromHttp(array $overrides = [], $trust_x_forwarded_headers = true, array $src = []) 
{
  $src = $src ?: \filter_input_array(INPUT_SERVER);
  //…
}
@AnrDaemon AnrDaemon self-assigned this Sep 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant