Skip to content

Commit

Permalink
Merge pull request #954 from serlo/staging
Browse files Browse the repository at this point in the history
Deployment
  • Loading branch information
hugotiburtino authored Dec 20, 2024
2 parents 77fad80 + a29924c commit 7940c4a
Show file tree
Hide file tree
Showing 74 changed files with 318 additions and 309 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/msw-npm-2.6.5-22d8e2075d-7396dd90fc.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
12 changes: 12 additions & 0 deletions __tests__/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ beforeEach(() => {
'/1658759018166-f30bdef5-b33f-480c-95b9-41b20a7926af.png': {
contentLength: 490,
},
'/wikimedia/video.webm': {
contentLength: 123456,
},
})
})

Expand Down Expand Up @@ -62,6 +65,15 @@ test('assets.serlo.org/legacy/<hash>/<fileName>.<ext>', async () => {
expectAsset({ response, expectedStoredContentLength: 899629 })
})

test('assets.serlo.org/wikimedia/*', async () => {
const response = await env.fetch({
subdomain: 'assets',
pathname: '/wikimedia/video.webm',
})

expectAsset({ response, expectedStoredContentLength: 123456 })
})

function givenAssets(assets: { [P in string]?: { contentLength: number } }) {
globalThis.server.use(
http.get(createUrlRegex({ subdomains: ['assets'] }), ({ request }) => {
Expand Down
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,41 +31,41 @@
},
"dependencies": {
"fp-ts": "^2.16.9",
"io-ts": "^2.2.21",
"io-ts": "^2.2.22",
"jose": "^5.9.6",
"toucan-js": "^4.0.0"
},
"devDependencies": {
"@cloudflare/workers-types": "^4.20241106.0",
"@eslint/compat": "^1.2.3",
"@cloudflare/workers-types": "^4.20241112.0",
"@eslint/compat": "^1.2.4",
"@eslint/eslintrc": "^3.2.0",
"@eslint/js": "^9.14.0",
"@eslint/js": "^9.17.0",
"@iarna/toml": "^2.2.5",
"@jest/globals": "^29.7.0",
"@sentry/types": "^8.36.0",
"@sentry/types": "^8.45.1",
"@testing-library/jest-dom": "^6.6.3",
"@types/iarna__toml": "^2.0.5",
"@types/jest": "^29.5.14",
"@typescript-eslint/eslint-plugin": "^8.13.0",
"@typescript-eslint/parser": "^8.14.0",
"@typescript-eslint/eslint-plugin": "^8.16.0",
"@typescript-eslint/parser": "^8.18.1",
"cross-env": "^7.0.3",
"depcheck": "^1.4.7",
"eslint": "^9.14.0",
"eslint": "^9.16.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-deprecation": "^3.0.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-react": "^7.37.2",
"globals": "^15.12.0",
"jest": "^29.7.0",
"msw": "^2.6.5",
"msw": "^2.6.8",
"npm-run-all": "^4.1.5",
"prettier": "^3.3.3",
"prettier-plugin-packagejson": "^2.5.3",
"prettier": "^3.4.2",
"prettier-plugin-packagejson": "^2.5.6",
"prettier-plugin-sh": "^0.14.0",
"ts-jest": "^29.2.5",
"ts-unused-exports": "^10.1.0",
"typescript": "^5.6.3",
"wrangler": "^3.86.1"
"typescript": "^5.7.2",
"wrangler": "^3.93.0"
},
"packageManager": "[email protected]",
"engines": {
Expand Down
6 changes: 5 additions & 1 deletion src/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ export async function semanticFileNames(request: Request) {
const re = /^\/(legacy\/|)((?!legacy)[\w-]+)\/([\w\-+]+)\.(\w+)$/
const match = re.exec(url.pathname)

if (!url.pathname.startsWith('/meta') && match) {
if (
!url.pathname.startsWith('/meta') &&
!url.pathname.startsWith('/wikimedia') &&
match
) {
const prefix = match[1]
const hash = match[2]
const extension = match[4]
Expand Down
Loading

0 comments on commit 7940c4a

Please sign in to comment.