As I am working on a research, I need allow users to read my JavaScript file using Ajax. However, I want to make sure about consequences of adding Access-Control-Allow-Origin header for just this file.

Access-Control-Allow-Origin: *

I know about the goal of origin control and all examples about accessing behalf of user. However, enabling this feature for just one static JS file can cause any security problem?

Any help is appreciated.

1 Answer 1


I don't think it can really cause any harm on a Javascript file. The problem starts when this is possible on a web page.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .