1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-18 02:17:05 +00:00

.DI() to ConfigureContainer(...builders)

Former-commit-id: 169671a8b5b706dc8f136e68c1a060f27a2c421b
This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-04-17 15:56:36 +03:00
parent eafa63da50
commit 1bb76853a9
12 changed files with 108 additions and 65 deletions

View File

@@ -1994,18 +1994,19 @@ func (ctx *context) GetContentType() string {
return ctx.writer.Header().Get(ContentTypeHeaderKey)
}
func trimHeaderValue(cType string) string {
for i, char := range cType {
// TrimHeaderValue returns the "v[0:first space or semicolon]".
func TrimHeaderValue(v string) string {
for i, char := range v {
if char == ' ' || char == ';' {
return cType[:i]
return v[:i]
}
}
return cType
return v
}
// GetContentType returns the request's header value of "Content-Type".
func (ctx *context) GetContentTypeRequested() string {
return trimHeaderValue(ctx.GetHeader(ContentTypeHeaderKey))
return TrimHeaderValue(ctx.GetHeader(ContentTypeHeaderKey))
}
// GetContentLength returns the request's header value of "Content-Length".