Skip to content

Commit

Permalink
dheerajsingh0-caddyserver#5858-Revise-redir-status-code-shortcuts
Browse files Browse the repository at this point in the history
  • Loading branch information
dheerajsingh0 committed Oct 7, 2023
1 parent 4feac4d commit f7e1073
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions caddyconfig/httpcaddyfile/builtins.go
Original file line number Diff line number Diff line change
Expand Up @@ -650,8 +650,12 @@ func parseRedir(h Helper) (caddyhttp.MiddlewareHandler, error) {
switch code {
case "permanent":
code = "301"
case "permanent-strict":
code = "308"
case "temporary", "":
code = "302"
case "temporary-strict":
code = "307"
case "html":
// Script tag comes first since that will better imitate a redirect in the browser's
// history, but the meta tag is a fallback for most non-JS clients.
Expand Down

0 comments on commit f7e1073

Please sign in to comment.