mirror of
https://github.com/restic/rest-server.git
synced 2025-12-06 17:15:45 -08:00
fixed imports
This commit is contained in:
@@ -3,6 +3,7 @@ package handlers
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"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)
|
||||
return
|
||||
}
|
||||
file := filepath.Join(config.DataPath(repo), id)
|
||||
file := filepath.Join(config.DataPath(repo), id.String())
|
||||
if _, err := os.Stat(file); err != nil {
|
||||
http.Error(w, "404 repository not found", 404)
|
||||
return
|
||||
@@ -37,7 +38,7 @@ func GetData(w http.ResponseWriter, r *http.Request) {
|
||||
http.Error(w, "403 invalid ID", 403)
|
||||
return
|
||||
}
|
||||
file := filepath.Join(config.DataPath(repo), id)
|
||||
file := filepath.Join(config.DataPath(repo), id.String())
|
||||
if _, err := os.Stat(file); err != nil {
|
||||
http.Error(w, "404 repository not found", 404)
|
||||
return
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package handlers
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user