Compare commits

...

2 commits

Author SHA1 Message Date
Akinimaginable
6d362bcf22 Merge pull request 'fix(backend): XSS on raw.' (#6) from fix-xss-raw into main
Reviewed-on: #6
2023-10-14 23:15:35 +00:00
Ada
5a175ef04a fix(backend): XSS on raw. 2023-10-12 15:29:14 +02:00

View file

@ -32,6 +32,7 @@ func handleRequest(w http.ResponseWriter, r *http.Request) {
if urlExist(clearPath) {
if strings.HasSuffix(path, "/raw") {
pasteContent := db.HGet(ctx, clearPath, "content").Val()
w.Header().Set("Content-Type", "text/plain")
_, err := io.WriteString(w, pasteContent)
if err != nil {
log.Println(err)