summaryrefslogtreecommitdiffstats
path: root/cnhttp.go
diff options
context:
space:
mode:
authorclsr <clsr@clsr.net>2017-08-27 22:03:53 +0200
committerclsr <clsr@clsr.net>2017-08-27 22:03:53 +0200
commit70d88b8a227b275850ef343cb4314ac36f32f64b (patch)
tree1e8b3c154b284c09c13805561fa83c54720d39c7 /cnhttp.go
parentcbb456c6d3c995e7856ad08e6fac844fe20796ec (diff)
downloadcn-http-70d88b8a227b275850ef343cb4314ac36f32f64b.tar.gz
cn-http-70d88b8a227b275850ef343cb4314ac36f32f64b.zip
Add initial support for CNM selectors
Diffstat (limited to 'cnhttp.go')
-rw-r--r--cnhttp.go13
1 files changed, 9 insertions, 4 deletions
diff --git a/cnhttp.go b/cnhttp.go
index bc949ca..205b515 100644
--- a/cnhttp.go
+++ b/cnhttp.go
@@ -143,6 +143,15 @@ func (srv *server) handleCNP(w http.ResponseWriter, r *http.Request, path string
return
}
+ err = r.ParseForm()
+ if err != nil {
+ srv.handleError(w, err)
+ }
+
+ if sel := r.FormValue("select"); sel != "" {
+ req.SetSelect("cnm", sel)
+ }
+
if ims := r.Header.Get("If-Modified-Since"); ims != "" {
var t time.Time
t, err = http.ParseTime(ims)
@@ -165,10 +174,6 @@ func (srv *server) handleCNP(w http.ResponseWriter, r *http.Request, path string
return
}
- err = r.ParseForm()
- if err != nil {
- srv.handleError(w, err)
- }
_, preq := r.Form["req"]
_, phdr := r.Form["hdr"]
_, presp := r.Form["resp"]