Is the given HTTP method (e.g., GET) non-destructive?

@param {string} method HTTP method to test
@param {string[]} [safeMethods] HTTP methods to consider as "safe"
@return {boolean}
function isSafeMethod(method, safeMethods) {
    method = method.toUpperCase();
    return (safeMethods || SAFE_METHODS).some(function(safeMethod) {
        return method.toUpperCase() === safeMethod;
    });
}