From Log I am getting Error:
ModSecurity: Access denied with code 403 (phase 2). Operator EQ matched 0 at REQUEST_HEADERS. [msg "Request Missing a User Agent Header"] [severity "NOTICE"] [tag "OWASP_CRS/PROTOCOL_VIOLATION/MISSING_HEADER_UA"]
But when I check in Network > XHR tab the header is present:
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36
I use standard AngularJS:
const ajax = function(data, url, completeFn, errorFn){
$http({
method: 'POST',
url: url,
data:data,
headers:{
'Accept': "application/json",
'Content-Type': "application/json"
}
})
.then( completeFn, errorFn );}
Later called by
this.select_all = function( callback ){
ajax({action: 'select_all'}, url,
function(response){
self.allFolders = response.data;
if(callback){ callback(response); }
},
defError
);}
I am using mod_rewrite rule:
<IfModule mod_rewrite.c>
RewriteEngine On
Options FollowSymLinks
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /webpage/#/$1 [L]
</IfModule>
When I completely disable mod_security everything works as it should. But I am not sure I want to do that. I googled for 2 hours couldn't find anything about similar issue. I must be doing something wrong. How should be this done?