allow CORS? #1868
Replies: 2 comments
|
Anubis isn't stripping it — there's no CORS code in the project at all. Searching the tree for Which points at what's actually happening: the response you're inspecting isn't your wiki's. When a request doesn't pass, So the question is why your ALLOW rule isn't matching the XHR when it matches the browser hitting the same URL. The usual culprit is the preflight. A cross-origin jQuery call that sets headers or uses a non-simple method makes the browser send an You can match it directly, since - name: allow-wiki-preflight
action: ALLOW
expression: method == "OPTIONS" && path.startsWith("/your/wiki/path")Worth checking your existing rule against the XHR too, not just the browser. If it keys on Quickest way to confirm any of this: Anubis stamps |
|
I tried what you suggested, so far no success. Maybe a little more context and a few observations: I am using an HTML page for testing the jQuery access to the wiki (provided by a colleague). You enter the URL, press a button and the request is generated. On a wiki without Anubis but with When using it with the Anubified wiki, I see this: The Apache log shows This is the request to Anubis itself. As mentioned in the other thread, usually I should see a second request (because I currently log all access to all vhosts to the same file), either with the same IP address or 127.0.0.1, but otherwise identical. This request is not seen, so indeed the request is not passed to the wiki port. The response does not contain specific X-Anubis headers, but two cookies Initially I had this rule to allow requests with the parameter I added, as you suggested BTW: If jQuery would generate OPTIONS requests, shouldn't they be visible in the Apache log? Is I just tried to add a logging rule to my bot policies (as per https://anubis.techaro.lol/docs/admin/policies), but the log file isn't even created. I'm not sure the policy file is read in the first place. Or this fiddeling with systemd to allow writing to a simple file in /tmp isn't working... |
Uh oh!
There was an error while loading. Please reload this page.
Despite #1860, technically I can use Anubis to protect my Wikis.
One of them needs CORS, so I have added the header
Access-Control-Allow-Origin: *. When accessing the wiki directly with a browser, this header is present in the reply. When accessing the same site using jQuery (with a modified URL for which I have added an ALLOW rule in the bot policy), this header gets removed and access to the page is denied.Does Anubis remove this header from the response? Is there a way to pass it through?
All reactions