repos / pico

pico services mono repo
git clone https://github.com/picosh/pico.git

commit
3c2cdad
parent
facce22
author
Eric Bower
date
2025-01-10 07:14:14 -0500 EST
fix(pgs): default redirect status should be `301`
2 files changed,  +2, -2
M pgs/redirect.go
+1, -1
1@@ -122,7 +122,7 @@ func parseRedirectText(text string) ([]*RedirectRule, error) {
2 			to := rest[toIndex]
3 			lastParts := rest[toIndex+1:]
4 			conditions := map[string]string{}
5-			sts := http.StatusOK
6+			sts := http.StatusMovedPermanently
7 			frcd := false
8 			if len(lastParts) > 0 {
9 				sts, frcd = hasStatusCode(lastParts[0])
M pgs/redirect_test.go
+1, -1
1@@ -50,7 +50,7 @@ func TestParseRedirectText(t *testing.T) {
2 			{
3 				From:       "/wow",
4 				To:         "/index.html",
5-				Status:     200,
6+				Status:     301,
7 				Query:      empty,
8 				Conditions: empty,
9 			},