MCPcopy
hub / github.com/pocketbase/pocketbase / setResponseHeaderIfEmpty

Method setResponseHeaderIfEmpty

tools/router/event.go:157–162  ·  view source on GitHub ↗
(key, value string)

Source from the content-addressed store, hash-verified

155const headerContentType = "Content-Type"
156
157func (e *Event) setResponseHeaderIfEmpty(key, value string) {
158 header := e.Response.Header()
159 if header.Get(key) == "" {
160 header.Set(key, value)
161 }
162}
163
164// String writes a plain string response.
165func (e *Event) String(status int, data string) error {

Callers 5

StringMethod · 0.95
HTMLMethod · 0.95
JSONMethod · 0.95
XMLMethod · 0.95
BlobMethod · 0.95

Calls 2

GetMethod · 0.65
SetMethod · 0.65

Tested by

no test coverage detected