steve/pkg/client/warn_panda.go
2022-09-19 12:00:06 +08:00

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))
}