#1632 Adding header to bypass Cross Domain request in privoxy problem ?

crossdomain (1)

I am trying to create a browser plugin and using privoxy to bypass cross domain policy in browser which checks for Access-Control-Allow-Origin: * this header in server-response if it is present browser processes the request correctly.

I have a local application running on port and i wish to access this with privoxy and I want privoxy to add that header so that browser can process the request.My version edits the Server: header and should replace it with Access-Control-Allow-origin but ?


SERVER-HEADER-FILTER: allow-crossdomain
s|Server: .|Access-Control-Allow-Origin: |


Not working ?? I have added them to end of these files.
I also tried a simple version by chaning s/Server/Test/g in the server header it is also not getting replaced . Please tell me what's wrong that I am doing ? and what is the correct way to add an header in the reply or edit the Server: header to Access-Control-Allow-Origin.


  • Fabian Keil
    Fabian Keil

    Your user.action excerpt lacks an URL pattern.

    If you check your test URL with http://config.privoxy.org/show-url-info, you'll probably see that the filter isn't applied.

    You could also enable the debug directives suggested at http://config.privoxy.org/user-manual/contact.html#SUFFCIENT-INFORMATION and check the log.

    Adding an URL pattern should enable the filter.

    There currently isn't a "proper" way to add a server header, so rewriting an existing header is the usual method. You can also append a new header to an existing header by using "\r\n". This is an undocumented "feature", though, and Privoxy itself will treat the two headers as one (changing this is TODO item #112).