rejetto / hfs2

web based file server
https://rejetto.com/hfs
GNU General Public License v3.0
601 stars 131 forks source link

Please provide header option Access-Control-Allow-Origin: * #18

Closed JB-DX closed 3 years ago

JB-DX commented 3 years ago

Current browsers don't allow Cross-Origin Resource Sharing (CORS). That's painful during development when using hfs to provide data-files. For this hfs needs to provide the header Access-Control-Allow-Origin: *

Could this be implemented, please?

Details: https://web.dev/cross-origin-resource-sharing/ https://stackoverflow.com/questions/10636611/how-does-access-control-allow-origin-header-work

rejetto commented 3 years ago

Use the add header command inside the [request] event, and you should be fine

JB-DX commented 3 years ago

Thanks for your answer. I found menu "edit event scripts", but don't know how to do that. Can you please advise?

rejetto commented 3 years ago

should be something like

[request]
{.add header| Access-Control-Allow-Origin: * .}

for further help please refer to the documentation: menu > help, or http://rejetto.com/wiki/index.php?title=HFS:_Event_scripts

and also the forum

JB-DX commented 3 years ago

Thank you, that works now !