Fixing more stuff

This commit is contained in:
2022-02-06 18:27:30 +01:00
parent 8bc01e0984
commit e582a75d9e
13 changed files with 56 additions and 38 deletions

View File

@@ -158,7 +158,7 @@ func articlePost(w http.ResponseWriter, r *http.Request) {
} else {
articleSummary.Tags = []string{}
}
articleSummary.Link = path.Join("/", config.SubPath, "article", url.PathEscape(articleSummary.Link))
articleSummary.Link = path.Join(config.SubPath, "article", url.PathEscape(articleSummary.Link))
w.WriteHeader(http.StatusCreated)
json.NewEncoder(w).Encode(articleSummary)
@@ -272,7 +272,7 @@ func articlePatch(w http.ResponseWriter, r *http.Request) {
} else {
articleSummary.Tags = []string{}
}
articleSummary.Link = path.Join("/", config.SubPath, "article", url.PathEscape(articleSummary.Link))
articleSummary.Link = path.Join(config.SubPath, "article", url.PathEscape(articleSummary.Link))
w.WriteHeader(http.StatusOK)
json.NewEncoder(w).Encode(articleSummary)