mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[feature/performance] Wrap incoming HTTP requests in timeout handler (#2353)
* deinterface router, start messing about with deadlines * weeeee * thanks linter (thinter) * write Connection: close when timing out requests * update wording * don't replace req * don't bother with fancy Cause functions (I'll use them one day...)
This commit is contained in:
@@ -35,7 +35,7 @@ type ActivityPub struct {
|
||||
signatureCheckMiddleware gin.HandlerFunc
|
||||
}
|
||||
|
||||
func (a *ActivityPub) Route(r router.Router, m ...gin.HandlerFunc) {
|
||||
func (a *ActivityPub) Route(r *router.Router, m ...gin.HandlerFunc) {
|
||||
// create groupings for the 'emoji' and 'users' prefixes
|
||||
emojiGroup := r.AttachGroup("emoji")
|
||||
usersGroup := r.AttachGroup("users")
|
||||
@@ -54,7 +54,7 @@ func (a *ActivityPub) Route(r router.Router, m ...gin.HandlerFunc) {
|
||||
}
|
||||
|
||||
// Public key endpoint requires different middleware + cache policies from other AP endpoints.
|
||||
func (a *ActivityPub) RoutePublicKey(r router.Router, m ...gin.HandlerFunc) {
|
||||
func (a *ActivityPub) RoutePublicKey(r *router.Router, m ...gin.HandlerFunc) {
|
||||
// Create grouping for the 'users/[username]/main-key' prefix.
|
||||
publicKeyGroup := r.AttachGroup(publickey.PublicKeyPath)
|
||||
|
||||
|
Reference in New Issue
Block a user