mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 16:32:25 -05: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:
parent
9ecb1c8aa5
commit
71dfea7e47
10 changed files with 63 additions and 55 deletions
|
|
@ -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/"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue