Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Development #2207

Merged
merged 15 commits into from
Feb 4, 2022
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@ updates:
directory: "/"
schedule:
interval: "daily"
target-branch: "development"
labels:
- "gomod"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
target-branch: "development"
labels:
- "github-actions"
1 change: 0 additions & 1 deletion app.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ func New(opts Options) *App {
}
a.Use(a.PanicHandler)
a.Use(RequestLogger)
a.Use(sessionSaver)

return a
}
11 changes: 10 additions & 1 deletion default_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ func (d *DefaultContext) Render(status int, rr render.Renderer) error {
if d.Session() != nil {
d.Flash().Clear()
d.Flash().persist(d.Session())
if err := d.Session().Save(); err != nil {
return HTTPError{Status: http.StatusInternalServerError, Cause: err}
}
}

d.Response().Header().Set("Content-Type", rr.ContentType())
Expand Down Expand Up @@ -191,7 +194,13 @@ var mapType = reflect.ValueOf(map[string]interface{}{}).Type()

// Redirect a request with the given status to the given URL.
func (d *DefaultContext) Redirect(status int, url string, args ...interface{}) error {
d.Flash().persist(d.Session())
if d.Session() != nil {
d.Flash().Clear()
d.Flash().persist(d.Session())
if err := d.Session().Save(); err != nil {
return HTTPError{Status: http.StatusInternalServerError, Cause: err}
}
}

if strings.HasSuffix(url, "Path()") {
if len(args) > 1 {
Expand Down
Loading