Skip to content

Conversation

@bcash
Copy link

@bcash bcash commented Oct 11, 2024

Not all servers provide a value for REQUEST_SCHEME. This offers a fallback in this case.

Please see https://stackoverflow.com/questions/18008135/is-serverrequest-scheme-reliable for discussion

Not all servers provide a value for REQUEST_SCHEME.  This offers a fallback in this case.

Please see https://stackoverflow.com/questions/18008135/is-serverrequest-scheme-reliable for discussion
@bcash
Copy link
Author

bcash commented Oct 11, 2024

Additional notes:

I noticed the previous PR #8 was based on CLI usage only and that setting the $_SERVER value in the environment was the preferred solution.

However, when running in non-CLI, $_SERVER may only be fixed by changing the server environment. This is not always possible.

Also, $curlOptions with a valid CURLOPT_REFERER may be passed in. But regardless of that, $defaultCurlOptions is still created, always referencing this undefined array key.

An alternative fix would be to define $defaultCurlOptions only if $curlOptions is null, but overriding this option is tricky and annoying as the custom referrer has to pass through three calls. But also in this case, the code will simply not work on installation for some developers running on these servers.

@bcash bcash closed this Oct 11, 2024
@bcash bcash deleted the patch-1 branch October 11, 2024 14:17
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

Successfully merging this pull request may close these issues.

1 participant