mirror of
https://github.com/kataras/iris.git
synced 2025-12-18 18:37:05 +00:00
Update to version 8.5.1. It contains a minor fix. Read HISTORY.md
https://github.com/kataras/iris/blob/master/HISTORY.md#tu-10-october-2017--v851 Former-commit-id: af1424c691613ccde911bef7d1371aa52e6abb79
This commit is contained in:
@@ -347,7 +347,19 @@ func (c *Controller) EndRequest(ctx context.Context) {
|
||||
ctx.ViewLayout(layout)
|
||||
}
|
||||
if len(c.Data) > 0 {
|
||||
ctx.Values().Set(ctx.Application().ConfigurationReadOnly().GetViewDataContextKey(), c.Data)
|
||||
dataKey := ctx.Application().ConfigurationReadOnly().GetViewDataContextKey()
|
||||
// In order to respect any c.Ctx.ViewData that may called manually before;
|
||||
if ctx.Values().Get(dataKey) == nil {
|
||||
// if no c.Ctx.ViewData then it's empty do a
|
||||
// pure set, it's faster.
|
||||
ctx.Values().Set(dataKey, c.Data)
|
||||
} else {
|
||||
// else do a range loop and set the data one by one.
|
||||
for k, v := range c.Data {
|
||||
ctx.ViewData(k, v)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ctx.View(view)
|
||||
|
||||
Reference in New Issue
Block a user