# HG changeset patch # User Sascha L. Teichmann # Date 1533567225 -7200 # Node ID 72c76ab112e9cacf61314d26d8386425b1a3a651 # Parent ad0e47c1fedf7858349078df05cfd868bb7dbf70 Compressing the namespaces in the WFS proxy is broken atm. So deactivate it. diff -r ad0e47c1fedf -r 72c76ab112e9 controllers/externalwfs.go --- a/controllers/externalwfs.go Mon Aug 06 16:46:42 2018 +0200 +++ b/controllers/externalwfs.go Mon Aug 06 16:53:45 2018 +0200 @@ -121,16 +121,16 @@ pw.Close() closer.Close() }() - if _, err := io.Copy(pw, r); err != nil { - log.Printf("rewrite failed: %v\n", err) - return - } /* - if err := rewrite(pw, r, prefix, to); err != nil { + if _, err := io.Copy(pw, r); err != nil { log.Printf("rewrite failed: %v\n", err) return } */ + if err := rewrite(pw, r, prefix, to); err != nil { + log.Printf("rewrite failed: %v\n", err) + return + } log.Println("rewrite successful") }(resp.Body) @@ -161,7 +161,7 @@ return strings.Replace(s, from, to, -1) } - var ns nsdef + //var ns nsdef tokens: for { @@ -175,7 +175,7 @@ switch t := tok.(type) { case xml.StartElement: - ns = ns.push() + //ns = ns.push() t = t.Copy() attr := make([]xml.Attr, len(t.Attr)) @@ -184,16 +184,16 @@ for i, at := range t.Attr { switch { case at.Name.Space == "xmlns": - ns.define(at.Value, at.Name.Local) + //ns.define(at.Value, at.Name.Local) attr[i] = xml.Attr{Name: at.Name, Value: at.Value} default: attr[i] = xml.Attr{Name: at.Name, Value: replace(at.Value)} } } - if s := ns.lookup(t.Name.Space); s != "" { - t.Name.Space = "" - t.Name.Local = s + ":" + t.Name.Local - } + //if s := ns.lookup(t.Name.Space); s != "" { + // t.Name.Space = "" + // t.Name.Local = s + ":" + t.Name.Local + //} t.Attr = attr tok = t @@ -202,12 +202,12 @@ case xml.EndElement: //log.Printf("lookup %s -> %s\n", t.Name.Space, ns.lookup(t.Name.Space)) - if s := ns.lookup(t.Name.Space); s != "" { - t.Name.Space = "" - t.Name.Local = s + ":" + t.Name.Local - tok = t - } - ns = ns.pop() + //if s := ns.lookup(t.Name.Space); s != "" { + // t.Name.Space = "" + // t.Name.Local = s + ":" + t.Name.Local + // tok = t + // } + // ns = ns.pop() } if err := encoder.EncodeToken(tok); err != nil { return err