Corion / Test-HTTP-LocalServer

spawn a local HTTP server for testing
Artistic License 2.0
1 stars 2 forks source link

malformed URL #4

Closed jorol closed 5 years ago

jorol commented 5 years ago

We got an issue with "malformed URL" in one of our tests, see https://github.com/LibreCat/Catmandu-SRU/issues/41. We used $server->url and passed it to Furl which will throw an error:

Passed malformed URL: http://[::1]:46249/?...

Is it possible to get a "proper" URL?

Corion commented 5 years ago

Hi,

The URL is generated from the socket class (ipv4 or ipv6), and should be routable in every case. I think the bug is more that Furl doesn't understand ipv6 HTTP URLs.

If you really want http://localhost:nnnn as URL, you can munge the URL in $server (untested) as a workaround:

$server->host('localhost')

-max

Am 23. September 2019 10:38:00 MESZ schrieb Johann Rolschewski notifications@github.com:

We got an issue with "malformed URL" in one of our test, see https://github.com/LibreCat/Catmandu-SRU/issues/41. We used $server->url and passed it to Furl which will throw an error:

Passed malformed URL: http://[::1]:46249/?...

Is it possible to get a "proper" URL?

-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/Corion/Test-HTTP-LocalServer/issues/4

-- Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.

Corion commented 5 years ago

... looking at the code, it's more like

$server->{_server_url}->host('localhost')

-max

Am 23. September 2019 10:38:00 MESZ schrieb Johann Rolschewski notifications@github.com:

We got an issue with "malformed URL" in one of our test, see https://github.com/LibreCat/Catmandu-SRU/issues/41. We used $server->url and passed it to Furl which will throw an error:

Passed malformed URL: http://[::1]:46249/?...

Is it possible to get a "proper" URL?

-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/Corion/Test-HTTP-LocalServer/issues/4

-- Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.

jorol commented 5 years ago

Thanks!