提交 5df1a6d3 编写于 作者: E Eric Eastwood

Add `X-Requested-With: XMLHttpRequest` header so Rails can recognize XHR

Backport from
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/3732
上级 1dac4271
......@@ -2,6 +2,8 @@ import axios from 'axios';
import csrf from './csrf';
axios.defaults.headers.common[csrf.headerKey] = csrf.token;
// Used by Rails to check if it is a valid XHR request
axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
// Maintain a global counter for active requests
// see: spec/support/wait_for_requests.rb
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册