mirror of
https://github.com/kataras/iris.git
synced 2026-01-09 21:15:56 +00:00
resolve conflicts with current master v11.1.1
Former-commit-id: 659ff392e889f3a8552d7da3d44848f1a364f7b2
This commit is contained in:
@@ -41,7 +41,7 @@ type ConfigurationReadOnly interface {
|
||||
// is disabled.
|
||||
//
|
||||
// By-default io.ReadAll` is used to read the body from the `context.Request.Body which is an `io.ReadCloser`,
|
||||
// if this field setted to true then a new buffer will be created to read from and the request body.
|
||||
// if this field set to true then a new buffer will be created to read from and the request body.
|
||||
// The body will not be changed and existing data before the
|
||||
// context.UnmarshalBody/ReadJSON/ReadXML will be not consumed.
|
||||
GetDisableBodyConsumptionOnUnmarshal() bool
|
||||
|
||||
@@ -369,7 +369,7 @@ type Context interface {
|
||||
// ContentType sets the response writer's header key "Content-Type" to the 'cType'.
|
||||
ContentType(cType string)
|
||||
// GetContentType returns the response writer's header value of "Content-Type"
|
||||
// which may, setted before with the 'ContentType'.
|
||||
// which may, set before with the 'ContentType'.
|
||||
GetContentType() string
|
||||
// GetContentType returns the request's header value of "Content-Type".
|
||||
GetContentTypeRequested() string
|
||||
@@ -669,7 +669,7 @@ type Context interface {
|
||||
//
|
||||
// This function may be used in the following cases:
|
||||
//
|
||||
// * if response body is too big (more than iris.LimitRequestBodySize(if setted)).
|
||||
// * if response body is too big (more than iris.LimitRequestBodySize(if set)).
|
||||
// * if response body is streamed from slow external sources.
|
||||
// * if response body must be streamed to the client in chunks.
|
||||
// (aka `http server push`).
|
||||
@@ -709,7 +709,7 @@ type Context interface {
|
||||
// is being called afterwards, in the same request.
|
||||
// Useful when need to set or/and change a layout based on the previous handlers in the chain.
|
||||
//
|
||||
// Note that the 'layoutTmplFile' argument can be setted to iris.NoLayout || view.NoLayout
|
||||
// Note that the 'layoutTmplFile' argument can be set to iris.NoLayout || view.NoLayout
|
||||
// to disable the layout for a specific view render action,
|
||||
// it disables the engine's configuration's layout property.
|
||||
//
|
||||
@@ -1762,7 +1762,7 @@ func (ctx *context) ContentType(cType string) {
|
||||
}
|
||||
|
||||
// GetContentType returns the response writer's header value of "Content-Type"
|
||||
// which may, setted before with the 'ContentType'.
|
||||
// which may, set before with the 'ContentType'.
|
||||
func (ctx *context) GetContentType() string {
|
||||
return ctx.writer.Header().Get(ContentTypeHeaderKey)
|
||||
}
|
||||
@@ -2597,7 +2597,7 @@ func (ctx *context) WriteWithExpiration(body []byte, modtime time.Time) (int, er
|
||||
//
|
||||
// This function may be used in the following cases:
|
||||
//
|
||||
// * if response body is too big (more than iris.LimitRequestBodySize(if setted)).
|
||||
// * if response body is too big (more than iris.LimitRequestBodySize(if set)).
|
||||
// * if response body is streamed from slow external sources.
|
||||
// * if response body must be streamed to the client in chunks.
|
||||
// (aka `http server push`).
|
||||
@@ -2714,7 +2714,7 @@ const (
|
||||
// is being called afterwards, in the same request.
|
||||
// Useful when need to set or/and change a layout based on the previous handlers in the chain.
|
||||
//
|
||||
// Note that the 'layoutTmplFile' argument can be setted to iris.NoLayout || view.NoLayout || context.NoLayout
|
||||
// Note that the 'layoutTmplFile' argument can be set to iris.NoLayout || view.NoLayout || context.NoLayout
|
||||
// to disable the layout for a specific view render action,
|
||||
// it disables the engine's configuration's layout property.
|
||||
//
|
||||
|
||||
@@ -18,7 +18,7 @@ type compressionPool struct {
|
||||
// |GZIP raw io.writer, our gzip response writer will use that. |
|
||||
// +------------------------------------------------------------+
|
||||
|
||||
// default writer pool with Compressor's level setted to -1
|
||||
// default writer pool with Compressor's level set to -1
|
||||
var gzipPool = &compressionPool{Level: -1}
|
||||
|
||||
// acquireGzipWriter prepares a gzip writer and returns it.
|
||||
|
||||
@@ -70,7 +70,7 @@ type ResponseWriter interface {
|
||||
|
||||
// SetBeforeFlush registers the unique callback which called exactly before the response is flushed to the client.
|
||||
SetBeforeFlush(cb func())
|
||||
// GetBeforeFlush returns (not execute) the before flush callback, or nil if not setted by SetBeforeFlush.
|
||||
// GetBeforeFlush returns (not execute) the before flush callback, or nil if not set by SetBeforeFlush.
|
||||
GetBeforeFlush() func()
|
||||
// FlushResponse should be called only once before EndResponse.
|
||||
// it tries to send the status code if not sent already
|
||||
|
||||
@@ -155,7 +155,7 @@ var RequestTransactionScope = TransactionScopeFunc(func(maybeErr TransactionErrR
|
||||
|
||||
// we need to register a beforeResponseFlush event here in order
|
||||
// to execute last the FireStatusCode
|
||||
// (which will reset the whole response's body, status code and headers setted from normal flow or other transactions too)
|
||||
// (which will reset the whole response's body, status code and headers set from normal flow or other transactions too)
|
||||
ctx.ResponseWriter().SetBeforeFlush(func() {
|
||||
// we need to re-take the context's response writer
|
||||
// because inside here the response writer is changed to the original's
|
||||
|
||||
Reference in New Issue
Block a user