mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[chore] shuffle middleware to split rate limitting into client/s2s/fileserver, share gzip middleware globally (#1290)
Signed-off-by: kim <grufwub@gmail.com> Signed-off-by: kim <grufwub@gmail.com>
This commit is contained in:
@ -68,7 +68,7 @@ func New(processor processing.Processor) *Module {
|
||||
}
|
||||
}
|
||||
|
||||
func (m *Module) Route(r router.Router) {
|
||||
func (m *Module) Route(r router.Router, mi ...gin.HandlerFunc) {
|
||||
// serve static files from assets dir at /assets
|
||||
assetsGroup := r.AttachGroup(assetsPathPrefix)
|
||||
webAssetsAbsFilePath, err := filepath.Abs(config.GetWebAssetBaseDir())
|
||||
@ -80,6 +80,7 @@ func (m *Module) Route(r router.Router) {
|
||||
|
||||
// use the cache middleware on all handlers in this group
|
||||
assetsGroup.Use(m.assetsCacheControlMiddleware(fs))
|
||||
assetsGroup.Use(mi...)
|
||||
|
||||
// serve static file system in the root of this group,
|
||||
// will end up being something like "/assets/"
|
||||
|
Reference in New Issue
Block a user