mirror of
https://github.com/go-kratos/kratos.git
synced 2026-05-22 10:15:24 +02:00
errors: add errors coder (#946)
* add errors coder * rename internal http to httputil * add errors proto
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
package http
|
||||
package httputil
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
@@ -11,15 +11,6 @@ const (
|
||||
baseContentType = "application"
|
||||
)
|
||||
|
||||
var (
|
||||
// HeaderAccept is accept header.
|
||||
HeaderAccept = http.CanonicalHeaderKey("Accept")
|
||||
// HeaderContentType is content-type header.
|
||||
HeaderContentType = http.CanonicalHeaderKey("Content-Type")
|
||||
// HeaderAcceptLanguage is accept-language header.
|
||||
HeaderAcceptLanguage = http.CanonicalHeaderKey("Accept-Language")
|
||||
)
|
||||
|
||||
// ContentType returns the content-type with base prefix.
|
||||
func ContentType(subtype string) string {
|
||||
return strings.Join([]string{baseContentType, subtype}, "/")
|
||||
@@ -1,4 +1,4 @@
|
||||
package http
|
||||
package httputil
|
||||
|
||||
import "testing"
|
||||
|
||||
Reference in New Issue
Block a user