Skip to content

Commit

Permalink
add 308 = http.StatusPermanentRedirect for redirect that was;t in per…
Browse files Browse the repository at this point in the history
…v. versions of Go
  • Loading branch information
Dean Karn authored and Dean Karn committed Sep 28, 2016
1 parent e170ce5 commit ea42f83
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
##LARS
<img align="right" src="https://raw.githubusercontent.com/go-playground/lars/master/examples/README/test.gif">
![Project status](https://img.shields.io/badge/version-3.4.1-green.svg)
![Project status](https://img.shields.io/badge/version-3.5.0-green.svg)
[![Build Status](https://semaphoreci.com/api/v1/projects/4351aa2d-2f94-40be-a6ef-85c248490378/679708/badge.svg)](https://semaphoreci.com/joeybloggs/lars)
[![Coverage Status](https://coveralls.io/repos/github/go-playground/lars/badge.svg?branch=master)](https://coveralls.io/github/go-playground/lars?branch=master)
[![Go Report Card](https://goreportcard.com/badge/go-playground/lars)](https://goreportcard.com/report/go-playground/lars)
Expand Down
2 changes: 1 addition & 1 deletion lars_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,7 @@ func TestRedirect(t *testing.T) {
Equal(t, code, http.StatusMovedPermanently)

code, _ = request(POST, "/home", l)
Equal(t, code, http.StatusTemporaryRedirect)
Equal(t, code, http.StatusPermanentRedirect)

l.SetRedirectTrailingSlash(false)

Expand Down
2 changes: 1 addition & 1 deletion util.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func (l *LARS) redirect(method string, to string) (handlers HandlersChain) {
code := http.StatusMovedPermanently

if method != GET {
code = http.StatusTemporaryRedirect
code = http.StatusPermanentRedirect
}

fn := func(c Context) {
Expand Down

0 comments on commit ea42f83

Please sign in to comment.