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

Function setRequestURLQuery

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

Source from the content-addressed store, hash-verified

849}
850
851func setRequestURLQuery(f filters.FilterContext) func(*lua.LState) int {
852 return func(s *lua.LState) int {
853 lv := s.Get(-1)
854 k := s.ToString(-2)
855 q := f.Request().URL.Query()
856 switch lv.Type() {
857 case lua.LTNil:
858 q.Del(k)
859 case lua.LTString:
860 str := string(lv.(lua.LString))
861 if str == "" {
862 q.Del(k)
863 } else {
864 q.Set(k, str)
865 }
866 default:
867 val := s.ToString(-1)
868 q.Set(k, val)
869 }
870 f.Request().URL.RawQuery = q.Encode()
871 return 0
872 }
873}
874
875func iterateRequestURLQuery(f filters.FilterContext) func(*lua.LState) int {
876 return func(s *lua.LState) int {

Callers 1

getRequestValueFunction · 0.85

Calls 3

GetMethod · 0.65
RequestMethod · 0.65
SetMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…