MCPcopy Create free account
hub / github.com/denoland/std / isProblemDetailsResponse

Function isProblemDetailsResponse

http/unstable_problem_details.ts:415–422  ·  view source on GitHub ↗
(response: Response)

Source from the content-addressed store, hash-verified

413 * ```
414 */
415export function isProblemDetailsResponse(response: Response): boolean {
416 const contentType = response.headers.get("Content-Type");
417 if (contentType === null) return false;
418 const semi = contentType.indexOf(";");
419 const base = semi === -1 ? contentType : contentType.substring(0, semi);
420 const mediaType = base.toLowerCase().trim();
421 return mediaType === PROBLEM_JSON_MEDIA_TYPE;
422}

Calls 1

getMethod · 0.65

Tested by

no test coverage detected