linkeddata / rdflib.js

Linked Data API for JavaScript
http://linkeddata.github.io/rdflib.js/doc/
Other
566 stars 146 forks source link

A fix to accept headers not being sent correctly in the Fetcher #437

Open s-minoo opened 4 years ago

s-minoo commented 4 years ago

There are 3 fixes contained inside this PR.

  1. Added support for another proxy URL template where the proxy servers doesn't work with URL parameters. This is the case where the proxy server only works with the following template : http://proxy.com/{uri}. For example, https://proxy.linkeddatafragments.org/ does this.

  2. We also added support for sending proxy request from http instead of requiring https. Maybe this might not be necessary, but it was needed in our use case. It would be nice if we could add an option to use http instead.

  3. Accept headers weren't being sent correctly with the HTTP requests. Apparently, the problem lies in the Header interface from typescript where the specified accept types doesn't get parsed correctly. We fixed it by making use of native javascript Object.assign({}, header}. Hopefully it won't cause a security concern with the fix.