ajax POST请求隐姓埋名工作,但不在chrome-404错误


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

如果我在这里遗漏了什么,请告诉我,此外,该应用程序部署在weblogic中——我们需要在weblogic控制台中做进一步的设置吗。

在更新Chrome后,我也遇到过类似的问题。当我从http切换到https 时,问题得到了解决

相关内容

最新更新