Skip to content

Commit

Permalink
revert get version
Browse files Browse the repository at this point in the history
  • Loading branch information
fforbeck committed Oct 1, 2024
1 parent 3518909 commit e37c45c
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 39 deletions.
19 changes: 0 additions & 19 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@
},
"scripts": {
"prepare": "npm run build",
"set-version": "cross-env $(node ./scripts/set-version-env.js)",
"start": "npm run dev",
"dev": "npm run build:debug && miniflare dist/worker.mjs --watch --debug -m --r2-persist --global-async-io --global-timers",
"build": "npm run set-version && esbuild --bundle src/index.js --format=esm --sourcemap --minify --outfile=dist/worker.mjs && npm run build:tsc",
"build:debug": "npm run set-version && esbuild --bundle src/index.js --format=esm --outfile=dist/worker.mjs",
"build": "esbuild --bundle src/index.js --format=esm --sourcemap --minify --outfile=dist/worker.mjs && npm run build:tsc",
"build:debug": "esbuild --bundle src/index.js --format=esm --outfile=dist/worker.mjs",
"build:tsc": "tsc --build",
"test:miniflare": "npm run build:debug && mocha --experimental-vm-modules --recursive test/**/*.spec.js",
"test:unit": "npm run build:debug && mocha --experimental-vm-modules --recursive test/unit/**/*.spec.js",
Expand Down Expand Up @@ -50,7 +49,6 @@
"@web3-storage/upload-client": "^16.1.1",
"carstream": "^2.1.0",
"chai": "^5.1.1",
"cross-env": "^7.0.3",
"esbuild": "^0.18.20",
"files-from-path": "^0.2.6",
"miniflare": "^3.20240909.5",
Expand Down
13 changes: 0 additions & 13 deletions scripts/set-version-env.js

This file was deleted.

1 change: 0 additions & 1 deletion src/bindings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export interface Environment {
DEBUG: string
CARPARK: R2Bucket
CONTENT_CLAIMS_SERVICE_URL?: string
RATE_LIMITS_SERVICE_URL?: string
ACCOUNTING_SERVICE_URL: string
RATE_LIMITER: RateLimit
AUTH_TOKEN_METADATA: KVNamespace
Expand Down
5 changes: 3 additions & 2 deletions src/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Dagula } from 'dagula'
import { HttpError } from '@web3-storage/gateway-lib/util'
import * as BatchingFetcher from '@web3-storage/blob-fetcher/fetcher/batching'
import * as ContentClaimsLocator from '@web3-storage/blob-fetcher/locator/content-claims'
import { version } from '../package.json'
import { CAR_CODE } from './constants.js'
import { handleCarBlock } from './handlers/car-block.js'

Expand All @@ -20,7 +21,7 @@ import { handleCarBlock } from './handlers/car-block.js'
*
* @type {import('@web3-storage/gateway-lib').Middleware<IpfsUrlContext, IpfsUrlContext, Environment>}
*/
export async function withCarBlockHandler (handler) {
export function withCarBlockHandler (handler) {
return async (request, env, ctx) => {
const { dataCid, searchParams } = ctx
if (!dataCid) throw new Error('missing data CID')
Expand Down Expand Up @@ -93,7 +94,7 @@ export function withContentClaimsDagula (handler) {
export function withVersionHeader (handler) {
return async (request, env, ctx) => {
const response = await handler(request, env, ctx)
response.headers.set('x-freeway-version', env.VERSION)
response.headers.set('x-freeway-version', version)
return response
}
}

0 comments on commit e37c45c

Please sign in to comment.