lemaiwo / ui5-middleware-route-proxy

UI5Tooling route proxy
MIT License
11 stars 4 forks source link

fix error thrown when proxying karma test runner #13

Closed toadslop closed 3 years ago

toadslop commented 3 years ago

When running Karma test runner using this proxy, an error is thrown.

In lib/proxy.js around line 18 a method 'header' is called on res. However, Karma sends requests that don't contain this method, thus when the check occurs it throws an error.

Since the request Karma is sending don't even need the header method, I added a check to see if the method is there. If it's not, the code just skips it, allowing Karma's requests to go through without a problem.

lemaiwo commented 3 years ago

Changes are merged and published to npm. Thank you for your contribution!