41 Commits (4ffbd78df56cf0be9b76737dba85c7588f59f5fb)

Author SHA1 Message Date
Barış Soner Uşaklı a478dc7ee8 feat: add filter:middleware.autoLocale 4 years ago
Peter Jaszkowiak 5c2f0f0557 chore: eslint no-restricted-syntax 4 years ago
Peter Jaszkowiak b56d9e12b5 chore: eslint prefer-arrow-callback 4 years ago
Peter Jaszkowiak 707b55b6a5 chore: eslint prefer-template 4 years ago
Barış Soner Uşaklı a05905f196
performance improvements (#8795)
* perf: nconf/winston/render

cache nconf.get calls
modify middleware.pageView to call next earlier
don't call winston.verbose on every hook see https://github.com/winstonjs/winston/issues/1669
translate header/footer separately and cache results for guests

* fix: copy paste fail

* refactor: style and fire hook only log in dev mode

* fix: cache key, header changes based on template

* perf: change replace

* fix: add missing await

* perf: category

* perf: lodash clone

* perf: remove escapeRegexChars
4 years ago
Julian Lam d68ffea80d feat: send 'Vary' header when ACAO header set 4 years ago
Barış Soner Uşaklı bbafa1b82a Revert "fix: [breaking] send configured config URL as origin if not custom"
This reverts commit 205a10308e.
4 years ago
Julian Lam 205a10308e fix: [breaking] send configured config URL as origin if not custom
This is a breaking change if your install uses multiple URLs to access. You will need to update the Access-Control-Allow-Origin header in ACP > Advanced > Headers to supply all URLs you use to access your site
4 years ago
Barış Soner Uşaklı 46ab2711d4 fix: #8432, add CSP frame-ancestors 4 years ago
Barış Soner Uşaklı 6fc31df033 feat: use const/let 4 years ago
Barış Soner Uşaklı 3761f05c98 feat: change invalid language codes to default lang 5 years ago
Barış Soner Uşaklı dcb85ee7a1
#8344 (#8346)
* feat: wip

* feat: wrap middlewares

* feat: middleware errors

* feat: more middleware changes

* fix: remove unused async

* fix: prevent version errors from blocking acp render

* feat: wrap more middlewares
5 years ago
Barış Soner Uşaklı 5781a2dc65
feat: fix session mismatch errors by clearing cookie on logout (#8338)
* feat: fix session mismatch errors by clearing cookie on logout

* feat: remove app.upateHeader

ported from 2.0

* feat: handle if user doesn't click button and just refreshes page
5 years ago
Julian Lam e327d1247e Revert "fix: #8142 invalid session warning if server-side session destroyed"
This reverts commit 526b3cd9ec.
5 years ago
Barış Soner Uşaklı 4263efa091 feat: don't overwrite req.query.lang if it exists 5 years ago
Julian Lam 526b3cd9ec fix: #8142 invalid session warning if server-side session destroyed
Resolved regression caused by 5a0c7c1497
5 years ago
Julian Lam eddbd86837 fix: tweak to session validation in addHeaders 5 years ago
Barış Soner Uşaklı 630f5d5b85 fix: only call clearCookie for logged in users 5 years ago
Barış Soner Uşaklı 5a0c7c1497 fix: register 5 years ago
Julian Lam d6e3f3f058
fix: #8142, broken site if no server-side session (#8148)
* fix: #8142, broken site if no server-side session

During the `addHeader` middleware, a check is now done to see if
`req.session.meta` is present. This value is only present if the user
has a valid server-side session.  If it is missing, then it is probably
safe to assume that the server-side session was deleted (either
intentionally or accidentally). In that scenario, the client-side cookie
should be cleared.

Also, there was an issue where the sessionRefresh flag was never cleared
after a successful login, so that was fixed too.

* feat: exported method to get cookie config

* fix: don't clear cookie if cookie is being set

* fix: socket.io tests

Co-authored-by: Barış Soner Uşaklı <[email protected]>
5 years ago
Barış Soner Uşaklı fdfbcc6efe feat: give names to more middlewares 6 years ago
Julian Lam 5f3d1c76c8
fix: #7038, autoLocale logic not playing nicely with no-refresh auths (#7059)
* fix: #7038, autoLocale logic not playing nicely with no-refresh auths

- on login, req.query.lang is deleted (since it seems to be left over)
- on logout, the middleware.autoLocale is executed, which resets
  req.query.lang
- middleware.autoLocale is new, just refactored existing logic in
  webserver.js into new middleware method.

* style: tests, use lodash

* fix: timeago strings not switching languages on login or out
6 years ago
renovate[bot] 64b9dabff8 chore(deps): update dependency eslint-config-airbnb-base to v13 (#6599)
* chore(deps): update dependency eslint-config-airbnb-base to v13

* chore: #6599, linting 😬
6 years ago
Barış Soner Uşaklı 14f6e74bad closes #6556 7 years ago
Barış Soner Uşaklı ae0f1847ae allow multiple origins for access-control-allow-origin header
add access-control-allow-credentials header to acp
7 years ago
Julian Lam 98b0bdc7e1 added helmet for better standard of protection across the board 7 years ago
Julian Lam 7edc58b727 stricter Referrer-Policy to reduce unintended information leakage 7 years ago
Julian Lam 9a1f722a05 appending X-Upstream-Hostname header in dev mode 7 years ago
Baris Usakli 59aeee6516 remove addExpiresHeaders 8 years ago
psychobunny e121a5a798 closes #5574 8 years ago
Peter Jaszkowiak 3b0dd2d1ef ESlint padded-blocks 8 years ago
Peter Jaszkowiak a038c66549 ESlint quotes 8 years ago
Peter Jaszkowiak 52f2028206 ESlint no-multiple-empty-lines 8 years ago
Peter Jaszkowiak bc1d70c126 ESlint comma-dangle 8 years ago
barisusakli 6beacdb80c fix headers for new installs
encodeURI(undefined) === "undefined"
8 years ago
Julian Lam b7fa8c1db1 fixes #5230 8 years ago
barisusakli 17f8afd0dc closes #5230 8 years ago
barisusakli c972a339e6 fix value 8 years ago
barisusakli 862678eefe encodeURIComponent header values 8 years ago
HeeL 4a3c31b2dc Fix space-before-function-paren linter rule 8 years ago
barisusakli 8f408faf46 organize middlewares
removed app.locals.middleware
middlewares can be required anywhere, ie in controllers
9 years ago