2024-01-04 20:36:41 +08:00
|
|
|
|
// Package consts ...
|
|
|
|
|
//
|
|
|
|
|
// Description : consts ...
|
|
|
|
|
//
|
|
|
|
|
// Author : go_developer@163.com<白茶清欢>
|
|
|
|
|
//
|
|
|
|
|
// Date : 2024-01-04 20:28
|
|
|
|
|
package consts
|
|
|
|
|
|
2024-11-25 16:15:57 +08:00
|
|
|
|
type HttpHeader string
|
|
|
|
|
|
|
|
|
|
func (hh HttpHeader) String() string {
|
|
|
|
|
return string(hh)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (hh HttpHeader) MarshalJSON() ([]byte, error) {
|
|
|
|
|
return []byte(hh.String()), nil
|
|
|
|
|
}
|
|
|
|
|
|
2024-01-04 20:36:41 +08:00
|
|
|
|
const (
|
2024-11-25 16:15:57 +08:00
|
|
|
|
HeaderKeyAccessControlAllowOrigin HttpHeader = "Access-Control-Allow-Origin" // 标识允许哪个域的请求
|
|
|
|
|
HeaderKeyAccessControlAllowHeaders HttpHeader = "Access-Control-Allow-Headers" // 标识允许的请求header
|
|
|
|
|
HeaderKeyAccessControlAllowMethods HttpHeader = "Access-Control-Allow-Methods" // 标识允许的请求方法
|
|
|
|
|
HeaderKeyAccessControlExposeHeaders HttpHeader = "Access-Control-Expose-Headers" // 允许浏览器端能够获取相应的header值
|
|
|
|
|
HeaderKeyAccessControlMaxAge HttpHeader = "Access-Control-Max-Age" // 控制发送预检请求options的频率,单位 : 秒
|
2024-01-04 20:36:41 +08:00
|
|
|
|
)
|