mliarakos/lagom-js

Client header parsing fails on empty header

Closed this issue · 1 comments

The ClientServiceCallInvoker.parseHeaders method fails if there are no response headers or if a header is empty. The method assumes headers will have the form "key: values".

The method uses xhr.getAllResponseHeaders() to get headers. In some cases a request will fail with no response headers (e.g., CORS issue), which causes getAllResponseHeaders() to return an empty string and the method to fail. Additionally, if a header was ever empty it would also cause the method to fail.

Fixed by #14.