MCPcopy Index your code
hub / github.com/ampproject/amphtml / normalizeMethod_

Function normalizeMethod_

src/utils/xhr-utils.js:337–349  ·  view source on GitHub ↗

* Normalized method name by uppercasing. * @param {string|undefined} method * @return {string} * @private

(method)

Source from the content-addressed store, hash-verified

335 * @private
336 */
337function normalizeMethod_(method) {
338 if (method === undefined) {
339 return 'GET';
340 }
341 method = method.toUpperCase();
342 devAssert(
343 allowedMethods_.includes(method),
344 'Only one of %s is currently allowed. Got %s',
345 allowedMethods_.join(', '),
346 method
347 );
348 return method;
349}
350
351/**
352 * If 415 or in the 5xx range.

Callers 1

setupInitFunction · 0.70

Calls 1

devAssertFunction · 0.90

Tested by

no test coverage detected