Rename HTTP method override header

This is the name recommended by the JSON-API spec:
http://jsonapi.org/recommendations/#patchless-clients
This commit is contained in:
Franz Liedke
2015-11-26 17:43:32 +01:00
parent a1e1635019
commit b3a5822ddb
2 changed files with 4 additions and 4 deletions

View File

@ -191,11 +191,11 @@ export default class App {
options.background = options.background || true;
// If the method is something like PATCH or DELETE, which not all servers
// support, then we'll send it as a POST request with a the intended method
// specified in the X-Fake-Http-Method header.
// and clients support, then we'll send it as a POST request with the
// intended method specified in the X-HTTP-Method-Override header.
if (options.method !== 'GET' && options.method !== 'POST') {
const method = options.method;
extend(options, 'config', (result, xhr) => xhr.setRequestHeader('X-Fake-Http-Method', method));
extend(options, 'config', (result, xhr) => xhr.setRequestHeader('X-HTTP-Method-Override', method));
options.method = 'POST';
}