aboutsummaryrefslogtreecommitdiff
path: root/service/service.go
diff options
context:
space:
mode:
authorr <r@freesoftwareextremist.com>2021-04-03 09:22:43 +0000
committerr <r@freesoftwareextremist.com>2021-04-03 09:24:39 +0000
commit76c5baef6ae8f5520ab40fef48532b6b5759384f (patch)
tree4826c83217ab73d7f7b9964190553027a2ed994a /service/service.go
parenta82745175e6e4cbd87c884a7ec7d0408e9a4f3d5 (diff)
downloadbloat-76c5baef6ae8f5520ab40fef48532b6b5759384f.tar.gz
bloat-76c5baef6ae8f5520ab40fef48532b6b5759384f.zip
Add option for user CSS
Diffstat (limited to 'service/service.go')
-rw-r--r--service/service.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/service/service.go b/service/service.go
index a29345e..5d80c28 100644
--- a/service/service.go
+++ b/service/service.go
@@ -64,6 +64,7 @@ func (s *service) authenticate(c *client, sid string, csrf string, ref string, t
CSRFToken: c.s.CSRFToken,
UserID: c.s.UserID,
AntiDopamineMode: sett.AntiDopamineMode,
+ UserCSS: sett.CSS,
Referrer: ref,
}
}()
@@ -888,6 +889,9 @@ func (s *service) SaveSettings(c *client, settings *model.Settings) (err error)
default:
return errInvalidArgument
}
+ if len(settings.CSS) > 1<<20 {
+ return errInvalidArgument
+ }
sess, err := s.sessionRepo.Get(c.s.ID)
if err != nil {
return