From 5dab0e50aa0a664ee953de1c5e781d3439a586c8 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Tue, 2 Dec 2014 14:26:32 +0100 Subject: [PATCH] Handle new format ID strings --- main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main.go b/main.go index 01b28251..ae294728 100644 --- a/main.go +++ b/main.go @@ -126,6 +126,9 @@ func newDataHandler(w http.ResponseWriter, r *http.Request) { } } + // The ID is base64 encoded, so can contain slashes. Replace those with dots instead. + idStr = strings.Replace(idStr, "/", ".", -1) + f, err := os.Create(path.Join(dir, idStr+".json")) if err != nil { log.Println(err)