VanVan / ipfsProxyHTTP

InterPlanetary File System HTTP Proxy
MIT License
49 stars 13 forks source link

adding CORS * support with javascript fetch #9

Closed chisNaN closed 3 years ago

chisNaN commented 3 years ago

Hello thanks for your implementation the speed difference is clearly visible nevertheless i cannot fetch from crossdomain without cors error restriction

const o = await(await fetch('https://ipns.co/QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG/readme')).text()
chisNaN commented 3 years ago

Impossible request. Because every nodes should comply to this

VanVan commented 3 years ago

Perhaps the solution could be to maintain two separate node lists to respond with the appropriate list according to the HTTP request transmitted

chisNaN commented 3 years ago

Good idea. if you can put an optional param for making priority to node having cors enabled

VanVan commented 3 years ago

The next question would be whether there is a list of nodes with cors enabled

chisNaN commented 3 years ago

for instance i know infura has cors* enabled but it should be dynamically check on the fly