Skip to content
Myr

Merge remote-tracking branch 'upstream/master' into validate

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Jimmy Pettersson · committed by Jimmy Pettersson · parents d7f4db4, 3b079bb · Browse files · 15 files+90 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

15 files+90 added−1 removed

  • other:+90 added−1 removed

15 files+90 added−1 removed

modified:binding/binding.go+4 added
1// Copyright 2014 Manu Martinez-Almeida. All rights reserved.2// Use of this source code is governed by a MIT style3// license that can be found in the LICENSE file.45package binding67import (8 "encoding/json"
208 unmodified lines
modified:render/render.go+4 added
1// Copyright 2014 Manu Martinez-Almeida. All rights reserved.2// Use of this source code is governed by a MIT style3// license that can be found in the LICENSE file.45package render67import (8 "encoding/json"
93 unmodified lines
modified:auth_test.go+4 added
1// Copyright 2014 Manu Martinez-Almeida. All rights reserved.2// Use of this source code is governed by a MIT style3// license that can be found in the LICENSE file.45package gin67import (8 "encoding/base64"
53 unmodified lines
modified:auth.go+4 added
1// Copyright 2014 Manu Martinez-Almeida. All rights reserved.2// Use of this source code is governed by a MIT style3// license that can be found in the LICENSE file.45package gin67import (8 "crypto/subtle"
84 unmodified lines
modified:context_test.go+4 added
1// Copyright 2014 Manu Martinez-Almeida. All rights reserved.2// Use of this source code is governed by a MIT style3// license that can be found in the LICENSE file.45package gin67import (8 "bytes"
434 unmodified lines
modified:context.go+4 added
1// Copyright 2014 Manu Martinez-Almeida. All rights reserved.2// Use of this source code is governed by a MIT style3// license that can be found in the LICENSE file.45package gin67import (8 "bytes"
269 unmodified lines
modified:deprecated.go+4 added
1// Copyright 2014 Manu Martinez-Almeida. All rights reserved.2// Use of this source code is governed by a MIT style3// license that can be found in the LICENSE file.45package gin67import (8 "github.com/gin-gonic/gin/binding"
39 unmodified lines
modified:gin_test.go+4 added
1// Copyright 2014 Manu Martinez-Almeida. All rights reserved.2// Use of this source code is governed by a MIT style3// license that can be found in the LICENSE file.45package gin67import (8 "io/ioutil"
199 unmodified lines
modified:gin.go+4 added
1// Copyright 2014 Manu Martinez-Almeida. All rights reserved.2// Use of this source code is governed by a MIT style3// license that can be found in the LICENSE file.45package gin67import (8 "fmt"
254 unmodified lines
modified:logger.go+4 added
1// Copyright 2014 Manu Martinez-Almeida. All rights reserved.2// Use of this source code is governed by a MIT style3// license that can be found in the LICENSE file.45package gin67import (8 "log"
74 unmodified lines
modified:mode.go+4 added
1// Copyright 2014 Manu Martinez-Almeida. All rights reserved.2// Use of this source code is governed by a MIT style3// license that can be found in the LICENSE file.45package gin67import (8 "os"
38 unmodified lines
modified:recovery_test.go+4 added
1// Copyright 2014 Manu Martinez-Almeida. All rights reserved.2// Use of this source code is governed by a MIT style3// license that can be found in the LICENSE file.45package gin67import (8 "bytes"
48 unmodified lines
modified:recovery.go+4 added
1// Copyright 2014 Manu Martinez-Almeida. All rights reserved.2// Use of this source code is governed by a MIT style3// license that can be found in the LICENSE file.45package gin67import (8 "bytes"
90 unmodified lines
modified:response_writer.go+34 added-1 removed
1// Copyright 2014 Manu Martinez-Almeida. All rights reserved.2// Use of this source code is governed by a MIT style3// license that can be found in the LICENSE file.45package gin67import (8 "bufio"9 "errors"10 "log"11 "net"12 "net/http"13)1415type (16 ResponseWriter interface {17 http.ResponseWriter18 http.Hijacker19 http.Flusher20 http.CloseNotifier2122 Status() int23 Written() bool24 WriteHeaderNow()25 }
11 unmodified lines
37 w.written = false38}3940func (w *responseWriter) WriteHeader(code int) {30 if code != 0 {41 if code > 0 {42 w.status = code43 if w.written {44 log.Println("[GIN] WARNING. Headers were already written!")45 }
18 unmodified lines
6465func (w *responseWriter) Written() bool {66 return w.written67}6869// Implements the http.Hijacker interface70func (w *responseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) {71 hijacker, ok := w.ResponseWriter.(http.Hijacker)72 if !ok {73 return nil, nil, errors.New("the ResponseWriter doesn't support the Hijacker interface")74 }75 return hijacker.Hijack()76}7778// Implements the http.CloseNotify interface79func (w *responseWriter) CloseNotify() <-chan bool {80 return w.ResponseWriter.(http.CloseNotifier).CloseNotify()81}8283// Implements the http.Flush interface84func (w *responseWriter) Flush() {85 flusher, ok := w.ResponseWriter.(http.Flusher)86 if ok {87 flusher.Flush()88 }89}
modified:utils.go+4 added
1// Copyright 2014 Manu Martinez-Almeida. All rights reserved.2// Use of this source code is governed by a MIT style3// license that can be found in the LICENSE file.45package gin67import (8 "encoding/xml"
42 unmodified lines