MCPcopy Create free account
hub / github.com/anomalyco/opencode / acceptHeader

Function acceptHeader

packages/core/src/tool/webfetch.ts:46–56  ·  view source on GitHub ↗
(format: Format)

Source from the content-addressed store, hash-verified

44type Format = (typeof Input.Type)["format"]
45
46const acceptHeader = (format: Format) => {
47 switch (format) {
48 case "markdown":
49 return "text/markdown;q=1.0, text/x-markdown;q=0.9, text/plain;q=0.8, text/html;q=0.7, */*;q=0.1"
50 case "text":
51 return "text/plain;q=1.0, text/markdown;q=0.9, text/html;q=0.8, */*;q=0.1"
52 case "html":
53 return "text/html;q=1.0, application/xhtml+xml;q=0.9, text/plain;q=0.8, text/markdown;q=0.7, */*;q=0.1"
54 }
55 return "*/*"
56}
57
58const headers = (format: Format, userAgent: string) => ({
59 "User-Agent": userAgent,

Callers 1

headersFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected