MCPcopy Create free account
hub / github.com/1buran/rHttp / correctHeader

Function correctHeader

main.go:171–180  ·  view source on GitHub ↗
(i *textinput.Model)

Source from the content-addressed store, hash-verified

169}
170
171func correctHeader(i *textinput.Model) {
172 // TODO use regexp instead
173 h := i.Value()
174 h = textproto.TrimString(h)
175 h = strings.ReplaceAll(h, " ", "-")
176 h = http.CanonicalHeaderKey(h)
177
178 // auto correct header name
179 i.SetValue(h)
180}
181
182func headersPrintf(h http.Header) []string {
183 var order, lines []string

Callers 1

setReqHeaderMethod · 0.85

Calls 1

ValueMethod · 0.80

Tested by

no test coverage detected