From 701245fcd3ef8b6640edc18fc0a779fa9fd44892 Mon Sep 17 00:00:00 2001 From: FrozenKP Date: Fri, 17 Mar 2017 00:22:09 +0800 Subject: [PATCH] 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,