Fixing more stuff
This commit is contained in:
@@ -19,12 +19,6 @@ var assetsPayload struct {
|
||||
}
|
||||
|
||||
func Assets(w http.ResponseWriter, r *http.Request) {
|
||||
_, ok := authorizedSession(r)
|
||||
if !ok {
|
||||
w.WriteHeader(http.StatusUnauthorized)
|
||||
return
|
||||
}
|
||||
|
||||
switch r.Method {
|
||||
case http.MethodGet:
|
||||
assetsGet(w, r)
|
||||
@@ -63,7 +57,7 @@ func assetsGet(w http.ResponseWriter, r *http.Request) {
|
||||
request.Find(&assets)
|
||||
|
||||
for _, asset := range assets {
|
||||
asset.Link = path.Join("/", config.SubPath, "assets", asset.Link)
|
||||
asset.Link = path.Join(config.SubPath, "assets", asset.Link)
|
||||
}
|
||||
|
||||
w.WriteHeader(http.StatusOK)
|
||||
@@ -116,7 +110,7 @@ func assetsPost(w http.ResponseWriter, r *http.Request) {
|
||||
json.NewEncoder(w).Encode(schema.Asset{
|
||||
Id: tmpDatabaseSchema.Id,
|
||||
Name: tmpDatabaseSchema.Name,
|
||||
Link: path.Join("/", config.SubPath, "assets", tmpDatabaseSchema.Link),
|
||||
Link: path.Join(config.SubPath, "assets", tmpDatabaseSchema.Link),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user