fix: legacy QR URLs without '?' (productid in path) redirect to /t/CODE (new tag 97 now scans); preview page photo portrait aspect; Preview button on user tags list; admin photo form = preview + standalone Upload button (removed URL TextInput — no duplicate, no stale placeholder)
This commit is contained in:
21
frontend/internal/handlers/legacy.go
Normal file
21
frontend/internal/handlers/legacy.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package handlers
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// LegacyNotFound handles old printed QR URLs of the form
|
||||
// https://where-woof.com/x=5&productid=CODE (no '?' before productid —
|
||||
// the whole thing lands in the path). Redirects to /t/CODE.
|
||||
func (a *App) LegacyNotFound(w http.ResponseWriter, r *http.Request) {
|
||||
path := r.URL.Path
|
||||
if i := strings.Index(path, "productid="); i >= 0 {
|
||||
code := path[i+len("productid="):]
|
||||
if code != "" {
|
||||
http.Redirect(w, r, "/t/"+code, http.StatusFound)
|
||||
return
|
||||
}
|
||||
}
|
||||
http.NotFound(w, r)
|
||||
}
|
||||
Reference in New Issue
Block a user