purescript-contrib / purescript-affjax

An asynchronous AJAX library built using Aff.
Apache License 2.0
122 stars 79 forks source link

On node.js don't override a base url already set in xhr2 #138

Closed paul-rouse closed 5 years ago

paul-rouse commented 5 years ago

xhr2 supports setting a base url globally on the prototype, using a static method. I was trying to do this, so it was rather distressing to find Affjax overriding it with localhost:smile:

This PR makes fixupUrl detect whether the xhr object has a defined nodejsBaseUrl, and if so it just behaves the same way as in the browser version. BTW the documentation comments say that this xhr2-only extension to the XHR API is "stable".

CLAassistant commented 5 years ago

CLA assistant check
All committers have signed the CLA.

garyb commented 5 years ago

Thanks!