MCPcopy Index your code
hub / github.com/anomalyco/opencode / cookie

Function cookie

packages/web/src/middleware.ts:21–24  ·  view source on GitHub ↗
(locale: string)

Source from the content-addressed store, hash-verified

19}
20
21function cookie(locale: string) {
22 const value = locale === "root" ? "en" : locale
23 return `oc_locale=${encodeURIComponent(value)}; Path=/; Max-Age=31536000; SameSite=Lax`
24}
25
26function redirect(url: URL, path: string, locale?: string) {
27 const next = new URL(url.toString())

Callers 1

redirectFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected