1
0
mirror of synced 2025-12-31 15:04:15 -05:00
Commit Graph

565 Commits

Author SHA1 Message Date
Kevin Heis
0886faddac Move language context to browser/session (#29433) 2022-07-28 18:50:46 +00:00
Kevin Heis
f79e1d2cb7 Fetch CSRF token over XHR (browser-side) (#29337)
* Client side csrf token grab

* Update get-session.ts

* Update get-session.ts

* Update get-session.ts

* Remove test refs to meta tag

* Update get-session.ts

* Update get-session.ts

* Update get-session.ts

* Update get-session.ts

* Fix some type issues

* Simplify api

* Update components/lib/get-session.ts

Co-authored-by: Rachael Sewell <rachmari@github.com>

Co-authored-by: Rachael Sewell <rachmari@github.com>
2022-07-27 16:18:07 +00:00
Kevin Heis
bb3cb78dd1 Move events under api (#29298) 2022-07-26 18:00:58 +00:00
Kevin Heis
2182ff28f3 Next12 now supports ESM (#29295)
* Next12 now supports ESM

* No more michael jackson script extensions

* Fix test running

* Update jest-puppeteer.config.cjs

* Update package.json
2022-07-26 17:53:23 +00:00
Kevin Heis
564e3a5e2a Move CSRF response back to XHR (Node.js prep) (#29179)
* Move CSRF response back to XHR

* Update events.js

* Pass through cookieJar

* Enable session route test

* Skip next x csrf test

* Add other fields to endpoint for future issues

* Remove client side parts

* Revert test skip

* Use nested router pattern

* ugh forgot a file

* Update naming

* Update tests/rendering/session.js

Co-authored-by: Peter Bengtsson <peterbe@github.com>

* Updating to use cache control

* Use req.langauge and req.userLanguage

Co-authored-by: Peter Bengtsson <peterbe@github.com>
2022-07-22 18:17:22 +00:00
Peter Bengtsson
cc197ccbf1 make it possible to control the rendering cache LRU sizes (#29180)
* make it possible to control the rendering cache LRU sizes

* Update middleware/cache-full-rendering.js

Co-authored-by: Robert Sese <734194+rsese@users.noreply.github.com>

* Update middleware/cache-full-rendering.js

Co-authored-by: Robert Sese <734194+rsese@users.noreply.github.com>

Co-authored-by: Robert Sese <734194+rsese@users.noreply.github.com>
2022-07-20 20:45:06 +00:00
Peter Bengtsson
9dce4cd96d redirect to language url for ghes 3.0 and 3.1 (#29136)
Co-authored-by: Hector Alfaro <hectorsector@github.com>
2022-07-19 15:22:48 +00:00
Peter Bengtsson
4bff926c7e inject language for legact admin/release-notes URLs (#29082) 2022-07-15 20:28:31 +00:00
Peter Bengtsson
e0a20add31 //en/some/path should redirect to /en/some/path (#29077)
* //en/some/path should redirect to /en/some/path

* remove debugging
2022-07-15 19:16:42 +00:00
Peter Bengtsson
642c971049 morgan logging off by default in tests (#28987) 2022-07-12 20:53:34 +00:00
Peter Bengtsson
2ebfb60b4b refactor how archived frontmatter fallbacks work (#28170)
* refactor how archived frontmatter fallbacks work

* delete no-longer used file

* avoid the mention

* Update lib/redirects/README.md

Co-authored-by: Sarah Schneider <sarahs@users.noreply.github.com>

Co-authored-by: Sarah Schneider <sarahs@users.noreply.github.com>
2022-07-12 20:23:05 +00:00
Matt Pollard
aa5130d3f5 Merge branch 'main' into imjohnbo-content-plan-6764 2022-07-02 12:34:14 +02:00
Peter Bengtsson
c1f0030e3a NextJS 12.1.6 (#26102)
* nextjs 12.1.0

* no idea what's going on

* desperate attempts

* wip

* lots of data is necessary for 'npm run build' now

* tidying up

* update package lock
2022-06-28 12:57:38 +00:00
Kevin Heis
f948c81038 Upgrade got (#28617)
* Upgrade got

* Update e2etest.js

* Skip following redirects on redirect tests

* Update deprecated-enterprise-versions.js
2022-06-21 16:23:51 +00:00
Peter Bengtsson
a39614fdcf remove supertest dependency (#28572)
* remove supertest dependency

* remove bad test
2022-06-16 15:56:41 +00:00
Peter Bengtsson
d4692b208e put the full plan name in the page titles (#28450)
* put the full plan name in the page titles

* fix tests
2022-06-16 13:29:23 +00:00
Peter Bengtsson
071c95a91c make miniToc pure data and no html strings (#28517)
* make miniToc pure data and no html strings

* fixups

* some types refactoring
2022-06-15 18:31:36 +00:00
Laura Coursen
799f2a5dec Merge branch 'main' into imjohnbo-content-plan-6764 2022-06-15 08:14:39 +01:00
Kevin Heis
71fedb1f31 Update to helmet 5 (#28488)
* Update to helmet 5

* Disable cross-origin-embedder-policy

* Update helmet.js

* Update helmet.js

* Add CORS on get / options

* Update helmet.js

* Update helmet.js

* Update helmet.js

* Update helmet.js

* Revert "Update helmet.js"

This reverts commit 61ad2fb641ca16a31bf148164c395f2ba91e1734.

* Open up github domains

* Include self

* Update helmet.js

* Update helmet.js
2022-06-14 21:43:25 +00:00
Sarah Schneider
157c82b09c error message tweaks for clarity 2022-06-13 16:10:40 -04:00
Peter Bengtsson
c45c378ad7 memoize reading lib/graphql/static/schema*.json files (#28443) 2022-06-13 18:21:22 +00:00
brannon
000a34a1a7 Add explicit config value to enable Fastly testing. 2022-06-03 09:52:02 -06:00
brannon
e7ec9ad487 Merge branch 'main' into brannon-serve-stale-content 2022-06-02 17:33:13 -06:00
brannon
d575b8edd6 Update Fastly test middleware to run in staging ONLY.
Add ability to set more headers to mimic real content responses.
Add ability to inject errors, to help in validating behavior.
2022-06-02 17:19:53 -06:00
Peter Bengtsson
d014f36222 fix external redirects (#28063)
* fix external redirects

* oops

* feedbacked
2022-06-02 02:06:29 +00:00
Peter Bengtsson
7e614adc12 wrap async middlewares correctly (#28030)
* wrap async middlewares correctly

* clean up more

* feedbacked
2022-06-01 15:13:23 +00:00
Mike Surowiec
8baf00154f disable per-request logging in production (#28056)
* disable per-request logging in production

* cleanup log disabling

Co-authored-by: Peter Bengtsson <mail@peterbe.com>
2022-05-31 21:34:10 +00:00
Peter Bengtsson
107d1d9176 understanding when the archived fallback redirects are used (#28128) 2022-05-31 18:27:44 +00:00
Peter Bengtsson
0340760554 remove spotContentFlaws middleware (#28068) 2022-05-31 18:19:16 +00:00
Peter Bengtsson
31c3fc36b2 don't fail on posting comment from English link checker (#28059)
* don't fail on posting comment from English link checker

* small correction on line break and longer timeout patience

* feedbacked
2022-05-31 18:05:39 +00:00
Peter Bengtsson
ca5e538c1b correct statsd prefix for cache full rendering (#27983) 2022-05-25 10:53:09 -04:00
Peter Bengtsson
75c0ec5cab /en/ permanent redirects to /en should be CDN cacheable (#27976) 2022-05-25 13:51:16 +00:00
Peter Bengtsson
9bef33aec4 let front door handle invalid paths (#27954) 2022-05-24 18:30:05 +00:00
Peter Bengtsson
5874a9c13b Don't bother render-caching if no next data script (#27944) 2022-05-24 15:39:33 +00:00
Mike Surowiec
fac6d5a85c feat: remove sigsci (#27932) 2022-05-24 09:49:19 -05:00
Peter Bengtsson
bb9bfac634 increase overload protection max delay to 500ms (#27912)
Co-authored-by: Mike Surowiec <mikesurowiec@users.noreply.github.com>
2022-05-24 00:42:59 +00:00
Peter Bengtsson
bfd9ae0aed fast root redirect (#27925) 2022-05-23 21:36:58 +00:00
Peter Bengtsson
e53f40cfc6 Optimize rendering cache (#27917)
* Optimize rendering cache

* deleted the wrong return

* put it back

* oops. thanks eslint
2022-05-23 18:32:05 +00:00
Peter Bengtsson
18504871b9 cache full rendering (#25424)
* cache full rendering

* still not working with gzip

* progress progress progress

* smaller

* hacky progress

* small fixes

* wip

* lock file

* wip

* wip

* package-lock updates

* wip

* search DOM in lowercase

* simplify

* with instrument

* improve test coverage

* mutateCheeriobodyByRequest

* fix

* remove renderContentCacheByContex

* disable render caching in sync-search

* diables things in github/github link checker

* gzip lru

* tidying up

* updated

* correct tests

* fix: move userLanguage to LanguagesContext

* Revert "fix: move userLanguage to LanguagesContext"

This reverts commit d7c05d958c71eaad496eb46764eb845d80b866ca.

* contexts ftw

* fixed rendering tests

* oops for got new file

* nits addressed

Co-authored-by: Mike Surowiec <mikesurowiec@users.noreply.github.com>
2022-05-23 12:12:09 +00:00
brannon
295de2e979 Change cache test env vars to read from HTTP headers instead. 2022-05-19 15:33:09 -06:00
brannon
6f5255cb92 Add comments explaining the purpose of the fastly-cache-test middleware. 2022-05-19 14:50:56 -06:00
brannon
b3ca430d48 Add env var to control stale cache parameters 2022-05-19 13:15:18 -06:00
brannon
671b9a81b9 Add endpoint for testing different cache settings in Fastly 2022-05-19 12:59:35 -06:00
Peter Bengtsson
27246f0c2a 300ms maxEventLoopDelay in overload-protection (#27656) 2022-05-18 03:00:07 +00:00
Peter Bengtsson
b0d1d5cd20 fix use of DISABLE_OVERLOAD_PROTECTION (#27711) 2022-05-16 13:51:38 +00:00
Peter Bengtsson
5630a4139a process.env.DISABLE_OVERLOAD_PROTECTION (#27692) 2022-05-13 15:29:52 -07:00
Peter Bengtsson
677d6a0bc9 unbreak sync-search by making overload protection configurable (#27680) 2022-05-13 16:51:37 +00:00
Peter Bengtsson
1108ecda90 remove loader.io middleware (#27678) 2022-05-13 08:16:19 -07:00
Peter Bengtsson
8580fb5e42 fast HEAD requests (#27672)
* fast HEAD requests

* update test
2022-05-13 14:46:57 +00:00
Peter Bengtsson
46303ebba7 more patience in the overload-protection (#27654) 2022-05-12 18:17:24 +00:00