Skip to content

Commit ea42f83

Browse files
Dean KarnDean Karn
authored andcommitted
add 308 = http.StatusPermanentRedirect for redirect that was;t in perv. versions of Go
1 parent e170ce5 commit ea42f83

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
##LARS
22
<img align="right" src="https://github.com/raw/go-playground/lars/master/examples/README/test.gif">
3-
![Project status](https://img.shields.io/badge/version-3.4.1-green.svg)
3+
![Project status](https://img.shields.io/badge/version-3.5.0-green.svg)
44
[![Build Status](https://semaphoreci.com/api/v1/projects/4351aa2d-2f94-40be-a6ef-85c248490378/679708/badge.svg)](https://semaphoreci.com/joeybloggs/lars)
55
[![Coverage Status](https://coveralls.io/repos/github/go-playground/lars/badge.svg?branch=master)](https://coveralls.io/github/go-playground/lars?branch=master)
66
[![Go Report Card](https://goreportcard.com/badge/go-playground/lars)](https://goreportcard.com/report/go-playground/lars)

lars_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,7 @@ func TestRedirect(t *testing.T) {
913913
Equal(t, code, http.StatusMovedPermanently)
914914

915915
code, _ = request(POST, "/home", l)
916-
Equal(t, code, http.StatusTemporaryRedirect)
916+
Equal(t, code, http.StatusPermanentRedirect)
917917

918918
l.SetRedirectTrailingSlash(false)
919919

util.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ func (l *LARS) redirect(method string, to string) (handlers HandlersChain) {
117117
code := http.StatusMovedPermanently
118118

119119
if method != GET {
120-
code = http.StatusTemporaryRedirect
120+
code = http.StatusPermanentRedirect
121121
}
122122

123123
fn := func(c Context) {

0 commit comments

Comments
 (0)