You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running JSCover in proxy mode, and a .js file is requested, the ProxyService class does not send the original request headers to the actual server, causing behavior changes and some times complete failure, especially if the "Cookie" header is involved.
I've changed the ProxyService#getUrl method to send all of the original request headers, (except for the "Accept-Encoding" header) and everything worked perfectly after that.
here is the modified method:
The "Accept-Encoding" header specifies to the server what type of encodings the client is willing to accept. An encoding is the format in which the response content is delivered, such as gzip.
If the "Accept-Encoding" header in the original request would contain for example "gzip" and the ProxyService would pass that along to the server, then the server would most likely respond with a content that is encoded in gzip. In such a case JSCover would have to unzip the content in order to instrument the .js file.
I thought it would just be easier to avoid all types of encodings altogether and receive the content as plain text.
When running JSCover in proxy mode, and a .js file is requested, the ProxyService class does not send the original request headers to the actual server, causing behavior changes and some times complete failure, especially if the "Cookie" header is involved.
I've changed the ProxyService#getUrl method to send all of the original request headers, (except for the "Accept-Encoding" header) and everything worked perfectly after that.
here is the modified method:
The text was updated successfully, but these errors were encountered: