From 701245fcd3ef8b6640edc18fc0a779fa9fd44892 Mon Sep 17 00:00:00 2001 From: FrozenKP Date: Fri, 17 Mar 2017 00:22:09 +0800 Subject: [PATCH 1/3] add GetHeader() to easily get header in Request --- context.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/context.go b/context.go index df001a40..29654a7d 100644 --- a/context.go +++ b/context.go @@ -390,6 +390,12 @@ func (c *Context) Header(key, value string) { } } +// GetHeader is a shortcut for c.Request.Header.Get(key) +// It get the header in th request. +func (c *Context) GetHeader(key string) { + return c.Request.Header.Get(key) +} + func (c *Context) SetCookie( name string, value string, From 617e515646298590978a7571ae3cac6eefda110b Mon Sep 17 00:00:00 2001 From: FrozenKP Date: Fri, 17 Mar 2017 00:25:10 +0800 Subject: [PATCH 2/3] add GetHeader() to easily get header in Request --- context.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/context.go b/context.go index 29654a7d..48362519 100644 --- a/context.go +++ b/context.go @@ -391,7 +391,7 @@ func (c *Context) Header(key, value string) { } // GetHeader is a shortcut for c.Request.Header.Get(key) -// It get the header in th request. +// It gets the header in the request. func (c *Context) GetHeader(key string) { return c.Request.Header.Get(key) } From c5c0d535b6873cbe80c21d8778681d4c3fb80b84 Mon Sep 17 00:00:00 2001 From: FrozenKP Date: Fri, 17 Mar 2017 00:32:38 +0800 Subject: [PATCH 3/3] GetHeader() add return string --- context.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/context.go b/context.go index 48362519..ea532545 100644 --- a/context.go +++ b/context.go @@ -392,7 +392,7 @@ func (c *Context) Header(key, value string) { // GetHeader is a shortcut for c.Request.Header.Get(key) // It gets the header in the request. -func (c *Context) GetHeader(key string) { +func (c *Context) GetHeader(key string) string { return c.Request.Header.Get(key) }