You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
forgejo/modules/context
wxiaoguang 5d77691d42
Improve template system and panic recovery (#24461)
Partially for #24457

Major changes:

1. The old `signedUserNameStringPointerKey` is quite hacky, use
`ctx.Data[SignedUser]` instead
2. Move duplicate code from `Contexter` to `CommonTemplateContextData`
3. Remove incorrect copying&pasting code `ctx.Data["Err_Password"] =
true` in API handlers
4. Use one unique `RenderPanicErrorPage` for panic error page rendering
5. Move `stripSlashesMiddleware` to be the first middleware
6. Install global panic recovery handler, it works for both `install`
and `web`
7. Make `500.tmpl` only depend minimal template functions/variables,
avoid triggering new panics

Screenshot:

<details>

![image](https://user-images.githubusercontent.com/2114189/235444895-cecbabb8-e7dc-4360-a31c-b982d11946a7.png)

</details>
1 year ago
..
access_log.go Improve template system and panic recovery (#24461) 1 year ago
api.go Improve template system and panic recovery (#24461) 1 year ago
api_org.go Implement FSFE REUSE for golang files (#21840) 2 years ago
api_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
captcha.go Add new captcha: cloudflare turnstile (#22369) 1 year ago
context.go Improve template system and panic recovery (#24461) 1 year ago
context_test.go Refactor "route" related code, fix Safari cookie bug (#24330) 1 year ago
csrf.go Refactor cookie (#24107) 1 year ago
form.go Implement FSFE REUSE for golang files (#21840) 2 years ago
org.go Add missing tabs to org projects page (#22705) 1 year ago
package.go Improve template system and panic recovery (#24461) 1 year ago
pagination.go Make branches list page operations remember current page (#23420) 1 year ago
permission.go Require repo scope for PATs for private repos and basic authentication (#24362) 1 year ago
private.go Improve template system and panic recovery (#24461) 1 year ago
repo.go Refactor `setting.Other` and remove unused `SHOW_FOOTER_BRANDING` (#24270) 1 year ago
response.go Implement FSFE REUSE for golang files (#21840) 2 years ago
utils.go Implement FSFE REUSE for golang files (#21840) 2 years ago
xsrf.go Update gitea-vet to check FSFE REUSE (#22004) 2 years ago
xsrf_test.go Update gitea-vet to check FSFE REUSE (#22004) 2 years ago