Repository navigation
Fix proxy handling when no proxy is configured - #23
Closed
Saeid-Abadi wants to merge 1 commit into
Closed
Saeid-Abadi wants to merge 1 commit into
Saeid-Abadi wants to merge 1 commit into
Conversation
Member
|
Hi, I think the error was a side effect of this #22 I tested the import with and without proxy and there are no issues. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When no proxy is configured, the import source fails with:
Failed to set proxy method Undefined array key "host" (Servicenow.php:74)
Cause: proxy_type is not stored when left empty, so it arrives as null. The fallback "?? 'UNKNOWN'" turns this into a non-empty string, the check "!== ''" passes, and the module tries to parse an empty proxy address.
Changes:
; Only enter the proxy branch if proxy_type is HTTP or SOCKS5.
; Accept proxy addresses without scheme and port (e.g. proxy.example.com). parse_url() only detects a host if a scheme or port is given, otherwise the value ends up in "path".
; Throw a clear error message for empty or invalid proxy addresses.
; URL-encode proxy credentials and only add them if a proxy user is set. Previously an empty user resulted in "http://:@host:port", and special characters in the password broke the proxy URL.