Looks like you were right and I was wrong, to some extend.
In local development the proxy ran by dfx start
will indeed look for the canister id in the following locations:
- Hostname
- Query string
- Referrer
The latter two are only needed for local development where you can’t easily have separate hostnames per canister; for the real deployment, the hostname should always be indicative.
Sorry for being thick-headed here!