mirror of
https://github.com/niusmallnan/steve.git
synced 2025-06-21 12:17:08 +00:00
18 lines
364 B
Go
18 lines
364 B
Go
package client
|
|
|
|
import (
|
|
"fmt"
|
|
"net/http"
|
|
|
|
"github.com/sirupsen/logrus"
|
|
)
|
|
|
|
type APIWarnings struct {
|
|
response http.ResponseWriter
|
|
}
|
|
|
|
func (am APIWarnings) HandleWarningHeader(code int, agent string, message string) {
|
|
logrus.Infof("====HandleWarningHeader===== %s", message)
|
|
am.response.Header().Add("X-API-Warnings", fmt.Sprintf("%d - %s", code, message))
|
|
}
|