dfinity / cycles-wallet

DFINITY Cycles Wallet
Apache License 2.0
55 stars 30 forks source link

Using a query param `canisterId` on localhost is broken #77

Closed hansl closed 3 years ago

hansl commented 3 years ago

From the last PR we mistakenly dropped using a query param for defining the canisterId. This broke the localhost flow as we cannot have subdomains on localhost.

nomeata commented 3 years ago

We can, but it requires editing of /etc/hosts (just being unhelpful here, while editing that is fine for advanced tests where hostname matter, the other flow is still needed)

hansl commented 3 years ago

Also Chrome supports it by default. Firefox and Safari don't.

nomeata commented 3 years ago

Chrome supports what by default? I thought /etc/hosts is a system feature, not an application feature of the TCP/IP stack?

hansl commented 3 years ago

Chrome supports sub domains on localhost.

Sent from my iPhone

On Apr 19, 2021, at 00:25, Joachim Breitner @.***> wrote:

 Chrome supports what by default? I thought /etc/hosts is a system feature, not an application feature of the TCP/IP stack?

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub, or unsubscribe.

nomeata commented 3 years ago

TIL! According to https://stackoverflow.com/questions/39666979/chrome-ignoring-hosts-file-for-subdomains-of-localhost it seems that Chrome hard-codes *.localhost, while the others are relying on the system, which also (normally) resolves *.localhost to ::1.

At least on Linux I can open http://foo.localhost in Firefox and it contacts 127.0.0.1… Maybe depends on the OS if it works?

hansl commented 3 years ago

Yeah I’m fairly certain that MacOS doesn’t do that unfortunately. It would have been a great alternative to query params considering their limitations.

Sent from my iPhone

On Apr 19, 2021, at 06:07, Joachim Breitner @.***> wrote:

 TIL! According to https://stackoverflow.com/questions/39666979/chrome-ignoring-hosts-file-for-subdomains-of-localhost it seems that Chrome hard-codes .localhost, while the others are relying on the system, which also (normally) resolves .localhost to ::1.

At least on Linux I can open http://foo.localhost in Firefox and it contacts 127.0.0.1… Maybe depends on the OS if it works?

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub, or unsubscribe.