Skip to content

parseurl("") breaks custom Proxy #290

@canning-duck

Description

@canning-duck

really this is #147, but we're using a custom Proxy and the behavior of parseurl("") breaks our code as we pass URL's String() to the function that actually searches for the proxy (Java's URI()/ ProxySelector.Select(), we're running on Android using gomobile)

To restate the issue: the connection URL is "wss://example.com/im/connect?foo=bar".

  • parseurl("") returns &url.URL{Scheme:"wss", Opaque:"/im/connect", Host:"example.com", RawQuery:"foo=bar"} that resolves to "wss:/im/connect?foo=bar" when calling String(). The problem is that the host is missing.
  • net/url.Parse() would return &url.URL{Scheme:"wss", Host:"example.com", Path:"/im/connect", RawQuery:"foo=bar"} that resolves to "wss://example.com/im/connect?foo=bar" as expected (go 1.9).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions