Search code examples
filecorsresponselocalfiddler

Fiddler local file with cors


Im trying to debug an api that returns some information based of the localization of the user, in a local file I have saved the JSON structure, but when I try to load it give me CORS error. How can I add CORS to my local file?

I have tried this answer but doesn't works for me: Cross Origin Policy & Fiddler JSON Debugging

Fiddler Rules


Solution

  • Just to close this, my final solution was mount a local server with xampp and create a php file that adds the headers and returns the json that I wanted:

    <?php
        header("Access-Control-Allow-Origin:*");
        header('content-type: application/json; charset=utf-8');
        echo '{"key":"value"}'
    ?>