comparison pkg/controllers/proxy.go @ 5712:6270951dda28 revive-cleanup

/interface{}/any/
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Tue, 20 Feb 2024 22:37:51 +0100
parents 31973f6f5cca
children
comparison
equal deleted inserted replaced
5711:2dd155cc95ec 5712:6270951dda28
34 "gemma.intevation.de/gemma/pkg/middleware" 34 "gemma.intevation.de/gemma/pkg/middleware"
35 ) 35 )
36 36
37 // proxyBlackList is a set of URLs that should not be rewritten by the proxy. 37 // proxyBlackList is a set of URLs that should not be rewritten by the proxy.
38 var proxyBlackList = map[string]struct{}{ 38 var proxyBlackList = map[string]struct{}{
39 "http://www.w3.org/2001/XMLSchema-instance": struct{}{}, 39 "http://www.w3.org/2001/XMLSchema-instance": {},
40 "http://www.w3.org/1999/xlink": struct{}{}, 40 "http://www.w3.org/1999/xlink": {},
41 "http://www.w3.org/2001/XMLSchema": struct{}{}, 41 "http://www.w3.org/2001/XMLSchema": {},
42 "http://www.w3.org/XML/1998/namespace": struct{}{}, 42 "http://www.w3.org/XML/1998/namespace": {},
43 "http://www.opengis.net/wfs/2.0": struct{}{}, 43 "http://www.opengis.net/wfs/2.0": {},
44 "http://www.opengis.net/ows/1.1": struct{}{}, 44 "http://www.opengis.net/ows/1.1": {},
45 "http://www.opengis.net/gml/3.2": struct{}{}, 45 "http://www.opengis.net/gml/3.2": {},
46 "http://www.opengis.net/fes/2.0": struct{}{}, 46 "http://www.opengis.net/fes/2.0": {},
47 "http://schemas.opengis.net/gml": struct{}{}, 47 "http://schemas.opengis.net/gml": {},
48 "http://www.opengis.net/wfs": struct{}{}, 48 "http://www.opengis.net/wfs": {},
49 } 49 }
50 50
51 func proxyDirector(lookup func(string) (string, bool)) func(*http.Request) { 51 func proxyDirector(lookup func(string) (string, bool)) func(*http.Request) {
52 52
53 return func(req *http.Request) { 53 return func(req *http.Request) {
54 54
55 //log.Debugf("proxyDirector: %s\n", req.RequestURI) 55 //log.Debugf("proxyDirector: %s\n", req.RequestURI)
56 56
57 abort := func(format string, args ...interface{}) { 57 abort := func(format string, args ...any) {
58 log.Errorf(format, args...) 58 log.Errorf(format, args...)
59 panic(http.ErrAbortHandler) 59 panic(http.ErrAbortHandler)
60 } 60 }
61 61
62 vars := mux.Vars(req) 62 vars := mux.Vars(req)