scripting / xml-rpc

XML-RPC client and server in JavaScript.
MIT License
61 stars 28 forks source link

Add support for CORS headers #14

Open soapdog opened 2 years ago

soapdog commented 2 years ago

Many browsers will do CORS verification when issuing XHR requests to servers on a different origin. At the moment, the XML-RPC server is not replying with the necessary headers to allow CORS to be successful.

A suggestion would be to add a new configuration option to the server to set up CORS, and have the server output those headers in all responses.

In my hacked version here, I've forced the headers in both returnErrorXml() and returnXml() which is not ideal but solved it for my little experimentation.