Closed fgravin closed 2 years ago
So I realized that if we get rid of fetch
and use XMLHttpRequest
it means we put another obstacle for nodejs compatibility. ogc-client is currently not nodejs compatible, there a few things here and there that produce errors, and it's not tested against regressions, but using XMLHttpRequest
means the only way to have node compatibility would be to include a polyfill as well.
I'm looking into this issue in a bit more details
Use
XMLHttpRequest
instead offetch
to perform the xhr requests to prevent from encoding issues.fetch
seems only able to handle UTF8 charset, whilexhr.responseText
seems correctly decoded by default.The URL https://georchestra.cbnbl.org/geoserver/ows?SERVICE=WMS&request=getcapabilities now works.
@jahow let me know if this solution is ok for you, i'all adapt the tests then.
Another solution could have been to try to guess the encoding of the response, and use
ArrayBuffer
to decode it accordingly.