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.
2 Likes
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?
3 Likes
Yes, looks like its working ok. I stopped it after seeing the warning
Thanks
2 Likes
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.
1 Like
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.
1 Like
Nope, no proxy etc setup. Just ran the sample out of box with no changes on Windows 10
1 Like
Are you using yarn start
? That does involve a proxy.
1 Like
@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).
2 Likes
Fix has been merged. Thanks @Arvind_Rao for the bug report!
4 Likes