From 5333f057626471c889b0a18f7816e5de4bf08def Mon Sep 17 00:00:00 2001 From: Mike Nolan Date: Sat, 26 Jul 2025 03:44:39 -0500 Subject: [PATCH] Add Redirect message --- .../src/program.tcross | 40 +++++++++++++++---- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/Tesses.CrossLang.PackageServer/src/program.tcross b/Tesses.CrossLang.PackageServer/src/program.tcross index 4d3b960..b281b1e 100644 --- a/Tesses.CrossLang.PackageServer/src/program.tcross +++ b/Tesses.CrossLang.PackageServer/src/program.tcross @@ -115,7 +115,10 @@ func main(args) var url = DB.ChangeMotto(userId,motto); ctx.StatusCode = 302; ctx.ResponseHeaders.SetValue("Location", url); - ctx.WriteHeaders(); + ctx.WithMimeType("text/html").SendText( +

Redirecting

+ Click here if it does not redirect +
); return true; } } @@ -176,7 +179,10 @@ func main(args) { ctx.StatusCode = 302; ctx.ResponseHeaders.SetValue("Location", "/"); - ctx.WriteHeaders(); + ctx.WithMimeType("text/html").SendText( +

Redirecting

+ Click here if it does not redirect +
); } else { @@ -326,7 +332,10 @@ func main(args) { ctx.StatusCode = 302; ctx.ResponseHeaders.SetValue("Location", "/"); - ctx.WriteHeaders(); + ctx.WithMimeType("text/html").SendText( +

Redirecting

+ Click here if it does not redirect +
); return true; } else { @@ -370,7 +379,10 @@ func main(args) ctx.StatusCode = 302; ctx.ResponseHeaders.SetValue("Location", "/"); ctx.ResponseHeaders.SetValue("Set-Cookie", $"Session={DB.CreateSession(accountId)}; SameSite=Strict"); - ctx.WriteHeaders(); + ctx.WithMimeType("text/html").SendText( +

Redirecting

+ Click here if it does not redirect +
); return true; } } @@ -384,7 +396,10 @@ func main(args) { ctx.StatusCode = 302; ctx.ResponseHeaders.SetValue("Location", "/"); - ctx.WriteHeaders(); + ctx.WithMimeType("text/html").SendText( +

Redirecting

+ Click here if it does not redirect +
); return true; } else { @@ -419,7 +434,10 @@ func main(args) { ctx.StatusCode = 302; ctx.ResponseHeaders.SetValue("Location", "/"); - ctx.WriteHeaders(); + ctx.WithMimeType("text/html").SendText( +

Redirecting

+ Click here if it does not redirect +
); return true; } else { @@ -462,7 +480,10 @@ func main(args) ctx.StatusCode = 302; ctx.ResponseHeaders.SetValue("Location", res.Redirect); - ctx.WriteHeaders(); + ctx.WithMimeType("text/html").SendText( +

Redirecting

+ Click here if it does not redirect +
); return true; } } @@ -522,7 +543,10 @@ func main(args) ctx.StatusCode = 302; ctx.ResponseHeaders.SetValue("Location", res.Redirect); - ctx.WriteHeaders(); + ctx.WithMimeType("text/html").SendText( +

Redirecting

+ Click here if it does not redirect +
); return true; } }