Skip to content

Fix proxy handling when no proxy is configured - #23

Closed
Saeid-Abadi wants to merge 1 commit into
NETWAYS:mainfrom
Saeid-Abadi:fix/proxy-handling
Closed

Saeid-Abadi wants to merge 1 commit into
NETWAYS:mainfrom
Saeid-Abadi:fix/proxy-handling

Conversation

@Saeid-Abadi

Copy link
Copy Markdown
Contributor

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.

@martialblog martialblog self-assigned this Oct 27, 2026
@martialblog martialblog added this to the v0.5.1 milestone Nov 9, 2026
@martialblog

Copy link
Copy Markdown
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.

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.

2 participants