diff --git a/server/go/camlistored/ui.go b/server/go/camlistored/ui.go index 3ca7f6102..8c7acf988 100644 --- a/server/go/camlistored/ui.go +++ b/server/go/camlistored/ui.go @@ -27,6 +27,7 @@ import ( "path/filepath" "regexp" + "camli/blobref" "camli/blobserver" "camli/jsonconfig" "camli/schema" @@ -128,6 +129,10 @@ func wantsUploadHelper(req *http.Request) bool { return req.Method == "POST" && camliMode(req) == "uploadhelper" } +func wantsPermanode(req *http.Request) bool { + return req.Method == "GET" && blobref.Parse(req.FormValue("p")) != nil +} + func (ui *UIHandler) ServeHTTP(rw http.ResponseWriter, req *http.Request) { base := req.Header.Get("X-PrefixHandler-PathBase") suffix := req.Header.Get("X-PrefixHandler-PathSuffix") @@ -142,6 +147,8 @@ func (ui *UIHandler) ServeHTTP(rw http.ResponseWriter, req *http.Request) { file := "" if m := staticFilePattern.FindStringSubmatch(suffix); m != nil { file = m[1] + } else if wantsPermanode(req) { + file = "permanode.html" } else if req.URL.Path == base { file = "index.html" } else { diff --git a/server/go/camlistored/ui/files.html b/server/go/camlistored/ui/files.html index 5538b9c74..251e98b35 100644 --- a/server/go/camlistored/ui/files.html +++ b/server/go/camlistored/ui/files.html @@ -16,4 +16,4 @@ or: