Skip to content
This repository has been archived by the owner on May 9, 2018. It is now read-only.

Certain url strings crash program with vague ":" error; no request is sent #36

Open
IamfromSpace opened this issue May 14, 2016 · 0 comments

Comments

@IamfromSpace
Copy link

No Error in the following cases:

"abc"
"abc.abc"
"abc/abc:123"
"123.123.123.123:123"
"123:123"
"123abc:123"

Error is thrown and no network call is made in the following cases:

"abc:abc"
"abc:123"
"abc.abc:123"
"abc123:123"
"abc-abc:123"
"abc-123:123"

In elm 0.17 the error is limited to ':', in elm 0.16 you also get many counts of the "Error: The notify function has been called synchronously! This can lead to frames being dropped." referenced in a number of issues including this one. This happens in reactor or via compiler.

What caught me (for longer than I'd like to admit) was using string: "localhost:123/foo/bar"--an easy mistake during development. Omitting the port, say "github.com/foo/bar", the request would have gone through as a relative URL (with a 404) and the bug/missing protocol would have been easy to spot.

I'm happy to open a PR, but I wanted to get some consensus on the right way to go about it. My suggestion would be to append "/" to the beginning any of the offending matches to avoid the error. Any concerns about potential side effects?

Elm has such great error reporting that it seems like this is worth fixing--it's a rare instance where something is going wrong and there's clear path on what to do.

IamfromSpace added a commit to IamfromSpace/elm-http that referenced this issue May 22, 2016
@magopian magopian mentioned this issue Sep 6, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant