summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/main.go b/main.go
index ce9a0ab..68037e8 100644
--- a/main.go
+++ b/main.go
@@ -86,6 +86,7 @@ func (handler BoxHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusUnauthorized)
return
}
+ ext := r.Header.Get("X-ResourceMeta-Extension")
u, err := uuid.NewRandom()
if err != nil {
log.Println(err)
@@ -93,7 +94,7 @@ func (handler BoxHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusInternalServerError)
return
}
- filename := filepath.Join(handler.filesPath, u.String())
+ filename := filepath.Join(handler.filesPath, u.String()) + ext
log.Printf("Boxing %s...\n", filename)
f, err := os.Create(filename)
if err != nil {