changed the method 'Header(key, value string)' on 'type Context' to 'SetHeader(key, value string)' for more clarity and to match the method 'GetHeader(key string)string'

This commit is contained in:
Needrima 2023-05-07 00:22:25 +01:00
parent eac2daac64
commit 051e9100ac
1 changed files with 1 additions and 1 deletions

View File

@ -858,7 +858,7 @@ func (c *Context) Status(code int) {
// Header is an intelligent shortcut for c.Writer.Header().Set(key, value).
// It writes a header in the response.
// If value == "", this method removes the header `c.Writer.Header().Del(key)`
func (c *Context) Header(key, value string) {
func (c *Context) SetHeader(key, value string) {
if value == "" {
c.Writer.Header().Del(key)
return