mirror of
https://github.com/restic/rest-server.git
synced 2026-09-25 21:41:25 -07:00
fixed imports
This commit is contained in:
+3
-2
@@ -3,6 +3,7 @@ package handlers
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"github.com/bchapuis/restic-server/config"
|
"github.com/bchapuis/restic-server/config"
|
||||||
@@ -19,7 +20,7 @@ func HeadData(w http.ResponseWriter, r *http.Request) {
|
|||||||
http.Error(w, "403 invalid ID", 403)
|
http.Error(w, "403 invalid ID", 403)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
file := filepath.Join(config.DataPath(repo), id)
|
file := filepath.Join(config.DataPath(repo), id.String())
|
||||||
if _, err := os.Stat(file); err != nil {
|
if _, err := os.Stat(file); err != nil {
|
||||||
http.Error(w, "404 repository not found", 404)
|
http.Error(w, "404 repository not found", 404)
|
||||||
return
|
return
|
||||||
@@ -37,7 +38,7 @@ func GetData(w http.ResponseWriter, r *http.Request) {
|
|||||||
http.Error(w, "403 invalid ID", 403)
|
http.Error(w, "403 invalid ID", 403)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
file := filepath.Join(config.DataPath(repo), id)
|
file := filepath.Join(config.DataPath(repo), id.String())
|
||||||
if _, err := os.Stat(file); err != nil {
|
if _, err := os.Stat(file); err != nil {
|
||||||
http.Error(w, "404 repository not found", 404)
|
http.Error(w, "404 repository not found", 404)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package handlers
|
package handlers
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user