Hi, I just got the latest template project from GitHub - digital-asset/daml-ui-template and followed the instructions to get the UI running using JS.
However when I try to exercise an option (GIVE), the sandbox shows the following errors.
14:07:13.846 [http-json-ledger-api-akka.actor.default-dispatcher-11] WARN akka.actor.ActorSystemImpl - Illegal header: Illegal 'origin' header: Illegal origin: Invalid input '/', expected DIGIT or 'EOI' (line 1, column 22): http://localhost:7575/
Please advise.
georg
May 19, 2020, 7:13pm
2
That warning is not of concern, I get it too all the time - but not sure why. I think it’s some strange header that the browser sets. The command should still go through though. Can you confirm?
Yes, looks like its working ok. I stopped it after seeing the warning
Thanks
georg
May 19, 2020, 7:21pm
4
Agree, it’s quite confusing when you first see it. Maybe someone with more intimate knowledge of the JSON API can chime in to understand why that’s being logged.
I have not seen it when used JSON API directly (create/exercise), might be related to how daml-ui constructs the HTTP Header.
@Arvind_Rao do you have a reverse proxy set up in front of the JSON API, anything that could modify the HTTP Header?
Illegal header: Illegal 'origin' header: Illegal origin: Invalid input '/', expected DIGIT or 'EOI' (line 1, column 22): http://localhost:7575/
My understanding, the Akka HTTP library that we use does not like / at the end of the origin header. Looking at the documentation: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Origin
Origin: null
Origin: <scheme> "://" <hostname> [ ":" <port> ]
so according to the spec, / is not allowed at the end of the origin.
Nope, no proxy etc setup. Just ran the sample out of box with no changes on Windows 10
Are you using yarn start? That does involve a proxy.
@Martin_Huschenbett @shaynefletcher I guess we need to remove / at the end of the proxy config.
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"proxy": "http://localhost:7575/"
}
@Arvind_Rao if you change package.json so proxy does not have a trailing slash, the warning should go away:
"proxy": "http://localhost:7575"
Please let us know if this fixed the warning and we will update the template.
I can reproduce, and I can confirm removing the trailing / in the package.json file resolves the issue (i.e. no more warning).
Fix has been merged. Thanks @Arvind_Rao for the bug report!