Skip to content

Commit

Permalink
add svg xml content type header for topview
Browse files Browse the repository at this point in the history
  • Loading branch information
paoloose committed Nov 29, 2024
1 parent a1a1829 commit 4ef2387
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions stiller-backend/internal/handlers/get_gallery.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package handlers

import (
"log"
"net/http"
"stiller/pkg/dbutils"
"stiller/pkg/jwt"
Expand All @@ -15,6 +16,7 @@ import (
)

func GetGallery(w http.ResponseWriter, r *http.Request, params httprouter.Params) {
log.Println("[info] GET /gallery/")
if netwrappers.CORS(w, r) {
return
}
Expand Down
5 changes: 5 additions & 0 deletions stiller-backend/internal/handlers/get_template.info.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ func GetTemplateInfo(w http.ResponseWriter, r *http.Request, params httprouter.P
case "data", "scene", "thumbnail", "topview":
templates.WriteTemplateSubfile(w, metatemplate_field, template_id)

// if fieldnamae is topview add header image/svg+xml
if metatemplate_field == "topview" {
w.Header().Add("Content-Type", "image/svg+xml")
}

default:
loggers.RequestLog(nil, "not a valid field", http.StatusNotFound, &w)
return
Expand Down

0 comments on commit 4ef2387

Please sign in to comment.