oracle / cordova-plugin-wkwebview-file-xhr

Cordova Plugin for WebView File XHR
Universal Permissive License v1.0
138 stars 118 forks source link

add space before the header value in getAllResponseHeaders #67

Closed ewfian closed 4 years ago

ewfian commented 4 years ago

This pull request add a single space before header value (after colon). then the polyfilled getAllResponseHeaders() will return the same format value with native

  1. The origin http header image

  2. Parsed response header image

  3. The return value of polyfilled getAllResponseHeaders() The space lost here image

  4. The FIRST CHAR LOST. Some 3rd libraries like azure-sdk-for-js makes http request by using XMLHttpRequest and parses header by itself just like following code https://github.com/Azure/azure-sdk-for-js/blob/744e51acb755db2c565c71a8856d8d13e6ec345b/sdk/core/core-https/src/xhrHttpsClient.ts#L129 If the return value from the polyfilled function XMLHttpRequest.getAllResponseHeaders() is not keeps the exact same format (Date: Thu, 01 Oct 2020 05:18:27 GMT\r\n) as the original value, some thing will broken. image

image

ewfian commented 4 years ago

Sorry for contributing rules. I will close this pull request and create an issue