Skip to content

Commit

Permalink
Allow cross domain ajax
Browse files Browse the repository at this point in the history
  • Loading branch information
willnode committed Dec 15, 2024
1 parent 00326cf commit 8e533d1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/executor/nginx.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,13 @@ class NginxExecutor {
idx = node.location.length - 1;
}
node.location[idx]._add('if', `($http_referer !~ "^https?://${info.dom}")`);
node.location[idx]._add('if', `($http_accept ~ "^text/html")`);
node.location[idx]._add('if', `($http_user_agent ~ "^Mozilla")`);
node.location[idx]._add('if', `($reject = "12")`);
node.location[idx]._add('if', `($reject = "123")`);
node.location[idx].if[0]._add('set', '$reject "${reject}1"');
node.location[idx].if[1]._add('set', '$reject "${reject}2"');
node.location[idx].if[2]._add('rewrite', '^ /deceptive.html last');
node.location[idx].if[2]._add('set', '$reject "${reject}3"');
node.location[idx].if[3]._add('rewrite', '^ /deceptive.html last');
node._add('location', '= /deceptive.html', []);
const iloc = node.location[node.location.length - 1]
iloc._add('root', '/usr/local/share/www');
Expand Down

0 comments on commit 8e533d1

Please sign in to comment.