Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Uppercases the
method
variable to sanitize the string
Summary:This prevents possible developer errors when using 'post' or 'put' instead of 'POST' and 'PUT'. Fixes: #6855 **Test plan:** Previously, a `method put must not have a request body` error would be thrown when the method was in lowercase and a request body was indeed included. With this fix and the following code (note the method name in all lowercase), the request is properly completed. ```javascript const url = 'http://myurl.com'; const request = new XMLHttpRequest(); request.open('put', url); request.setRequestHeader("Content-type","application/json"); request.onload = function() { console.log('onload'); }; request.onerror = function() { console.log('error'); }; request.send(JSON.stringify({ something: 'here' })); ``` Closes #6956 Differential Revision: D3173467 Pulled By: davidaurelio fb-gh-sync-id: add90e9f31cd4f548547a3f85267a782ae74a89c fbshipit-source-id: add90e9f31cd4f548547a3f85267a782ae74a89c
- Loading branch information