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

Method setReqMethod

main.go:454–467  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

452}
453
454func (m *model) setReqMethod() {
455 defer func() {
456 recover() // BUG: textinput.(*Model).CurrentSuggestion(...) cause panic first time
457 }()
458 r := regexp.MustCompile(`(?i)\b` + m.inputs[method].Value())
459 if r.MatchString(strings.Join(allowedMethods, " ")) {
460 m.inputs[method].SetValue(m.inputs[method].CurrentSuggestion())
461 m.req.Method = m.inputs[method].Value()
462 m.inputs[method].SetCursor(len(m.req.Method))
463 } else { // not allowed HTTP method, reset to last saved
464 m.inputs[method].SetValue(m.req.Method)
465 m.inputs[method].CursorEnd()
466 }
467}
468
469func (m *model) setReqUrlPath() {
470 val := m.inputs[urlPath].Value()

Callers 1

nextInputMethod · 0.95

Calls 1

ValueMethod · 0.80

Tested by

no test coverage detected