Commit Graph

9 Commits

Author SHA1 Message Date
Barış Soner Uşaklı
c15bdd4cf0 👋Request, 🐶 Fetch, closes #10341 (#12236)
* axios migration

* controller tests

* add missing deps

* feeds

* remove unused async

* flags

* locale-detect

* messaging/middleware

* remove log

* meta

* plugins

* posts

* search

* topics/thumbs

* user/emails

* uploads.js

* socket.io

* cleaunup

* test native fetch

* cleanup

* increase engine to 18

fix remaining tests

* remove testing file

* fix comments,typo

* revert debug
2023-12-18 12:08:34 -05:00
Barış Soner Uşaklı
b398321a5e Chat with privileged (#12092)
* Update headers.js

Fixes X-Upstream-Hostname header for os hostnames with invalid characters

* Added missing period in allowed hostname chars

Allowed hostname chars should include A-Za-z0-9-. based on https://man7.org/linux/man-pages/man7/hostname.7.html

* feat: add chat:privileged global privilege

to only allow chatting with privileged users

* test: fix priv test

* test: one more fix

---------

Co-authored-by: chadjw <chad.warner@gmail.com>
2023-10-17 13:19:25 -04:00
Julian Lam
c07d595662 Update to lru-cache@^7 (#10815)
* chore(deps): bump lru-cache from 6.0.0 to 7.13.1 in /install

Bumps [lru-cache](https://github.com/isaacs/node-lru-cache) from 6.0.0 to 7.13.1.
- [Release notes](https://github.com/isaacs/node-lru-cache/releases)
- [Changelog](https://github.com/isaacs/node-lru-cache/blob/main/CHANGELOG.md)
- [Commits](https://github.com/isaacs/node-lru-cache/compare/v6.0.0...v7.13.1)

---
updated-dependencies:
- dependency-name: lru-cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix(lru-cache): remove unneeded `length` params for cache creation, as `maxSize` was not used in those init calls, also renamed some methods to match new method names in lru-cache [breaking]

Added deprecation notices for old params

* fix: replace three direct calls to lru-cache with call to cacheCreate, moved cache creation call in uploads to run on first init as config is not populated at lib init

* test: move configs init above cache reset calls in databasemock

* move some more code above cache clear

* refactor: remove unused

* test: lru

* test: more debug

* test: on more test

* use await helpers.uploadFile

* fix: tests remove logs

* fix: acp cache page

* fix: add in one more guard again cache instantiation with `length` prop but no `maxSize` prop

* fix(deps): bump markdown

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Barış Soner Uşaklı <barisusakli@gmail.com>
2022-08-10 13:24:16 -04:00
Julian Lam
38ca73c493 fix(security): explicitly declare cache-control header instead of using middleware
This commit reverts 1f6f389ff2
2022-03-18 11:56:16 -04:00
Julian Lam
1f6f389ff2 fix(security): cache-control on all pages using setupPageRoute or setupApiRoute, and 404 controllers.
This commit also reverts e39cdd490b
2022-03-17 21:42:26 -04:00
Barış Soner Uşaklı
24c1f879a5 test: fix middleware test 2022-03-11 23:50:28 -05:00
Julian Lam
6c07433dea refactor: use routePrefixMap instead of routeRegexpMap, +tests (#10035)
* refactor: use routePrefixMap instead of routeRegexpMap, +tests

Currently tests fail because privilege pages resolve if passed garbage... hmm

* fix: priv check paths

remove /v3 from path as well

Co-authored-by: Barış Soner Uşaklı <barisusakli@gmail.com>
2021-11-26 13:53:53 -05:00
Barış Soner Uşaklı
d7c32ccbc2 test: remove log 2021-11-22 20:01:47 -05:00
Barış Soner Uşaklı
29b3587d91 test: middleware/expose.js 2021-11-22 19:56:12 -05:00