Below is my code:
function editUser(ext,randomUID){
var csrfParameter = $("meta[name='_csrf_parameter']").attr("content");
var csrfHeader = $("meta[name='_csrf_header']").attr("content");
var csrfToken = $("meta[name='_csrf']").attr("content");
var headers = {};
headers[csrfHeader] = csrfToken;
$.ajax({
type : "POST",
url : "api/v1/user/editUser/"+randomUID+"/"+ext,
headers:headers,
success : function(response) {
// Do something
}
Above works perfectly in Incognito mode but not in chrome. It always gives me 404() not found. I have seen many threads regarding cache control for POST requests. But none of them worked, by default cache control is handled by spring security and for all POST requests I see in console response headers as below:
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Type: application/json;charset=UTF-8
Date: Sun, 08 Mar 2020 09:41:48 GMT
Expires: 0
Pragma: no-cache
Server: MAM
Set-Cookie: XSRF-TOKEN=bcd84bb3-a709-4876-aa6a-0e4b3404a58e
Set-Cookie: XSRF-TOKEN=bcd84bb3-a709-4876-aa6a-0e4b3404a58e
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
Transfer-Encoding: chunked
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
Пожалуйста, дайте мне знать, если я что-то здесь упускаю, кроме того, приложение развернуто в weblogi c - Нужны ли нам дополнительные настройки в консоли weblogi c.