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

Commit

Permalink
Merge pull request #2207 from gobuffalo/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
paganotoni committed Feb 4, 2022
2 parents d0eaea4 + 96d2173 commit c9873bd
Show file tree
Hide file tree
Showing 15 changed files with 887 additions and 143 deletions.
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

0 comments on commit c9873bd

Please sign in to comment.