mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-15 13:02:14 +08:00
Merge remote-tracking branch 'origin/master' into doc-deprecated
This commit is contained in:
commit
270c902726
1
auth.go
1
auth.go
@ -91,6 +91,7 @@ func authorizationHeader(user, password string) string {
|
||||
return "Basic " + base64.StdEncoding.EncodeToString(bytesconv.StringToBytes(base))
|
||||
}
|
||||
|
||||
// BasicAuthForProxy returns a Basic HTTP Proxy-Authorization middleware.
|
||||
func BasicAuthForProxy(accounts Accounts, realm string) HandlerFunc {
|
||||
if realm == "" {
|
||||
realm = "Proxy Authorization Required"
|
||||
|
@ -1044,7 +1044,7 @@ func TestContextRenderAndEscapeAttachment(t *testing.T) {
|
||||
c.FileAttachment("./gin.go", maliciousFilename)
|
||||
|
||||
assert.Equal(t, 200, w.Code)
|
||||
assert.Contains(t, w.Body.String(), "func New() *Engine {")
|
||||
assert.Contains(t, w.Body.String(), "func New(opts ...OptionFunc) *Engine {")
|
||||
assert.Equal(t, fmt.Sprintf("attachment; filename=\"%s\"", actualEscapedResponseFilename), w.Header().Get("Content-Disposition"))
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user