MCPcopy Index your code
hub / github.com/zalando/skipper / setRequestValue

Function setRequestValue

script/script.go:529–554  ·  view source on GitHub ↗
(f filters.FilterContext)

Source from the content-addressed store, hash-verified

527}
528
529func setRequestValue(f filters.FilterContext) func(*lua.LState) int {
530 return func(s *lua.LState) int {
531 key := s.ToString(-2)
532 switch key {
533 case "outgoing_host":
534 f.SetOutgoingHost(s.ToString(-1))
535 case "url":
536 u, err := url.Parse(s.ToString(-1))
537 if err != nil {
538 // TODO(sszuecs): https://github.com/zalando/skipper/issues/1487
539 // s.RaiseError("%v", err)
540 return 0
541 }
542 f.Request().URL = u
543 case "url_path":
544 f.Request().URL.Path = s.ToString(-1)
545 case "url_raw_query":
546 f.Request().URL.RawQuery = s.ToString(-1)
547 default:
548 // TODO(sszuecs): https://github.com/zalando/skipper/issues/1487
549 // s.RaiseError("unsupported request field %s", key)
550 // do nothing for now
551 }
552 return 0
553 }
554}
555
556func getResponseValue(f filters.FilterContext) func(*lua.LState) int {
557 var header *lua.LTable

Callers 1

getContextValueFunction · 0.85

Calls 3

SetOutgoingHostMethod · 0.65
ParseMethod · 0.65
RequestMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…