diff --git a/packages/pds/src/api/app/bsky/feed/getPostThread.ts b/packages/pds/src/api/app/bsky/feed/getPostThread.ts index 087e3738bb2..aad69b5c2fb 100644 --- a/packages/pds/src/api/app/bsky/feed/getPostThread.ts +++ b/packages/pds/src/api/app/bsky/feed/getPostThread.ts @@ -37,7 +37,7 @@ export default function (server: Server, ctx: AppContext) { const { auth, params } = reqCtx const requester = auth.credentials.did - const rev = err.headers && getRepoRev(err.headers) + const rev = getRepoRev(err.headers) if (!rev) throw err const uri = new AtUri(params.uri) diff --git a/packages/pds/src/read-after-write/util.ts b/packages/pds/src/read-after-write/util.ts index fd3ae13e544..9cd03402de6 100644 --- a/packages/pds/src/read-after-write/util.ts +++ b/packages/pds/src/read-after-write/util.ts @@ -20,8 +20,8 @@ import { getRecordsSinceRev } from './viewer' const REPO_REV_HEADER = 'atproto-repo-rev' -export const getRepoRev = (headers: HeadersMap): string | undefined => { - return headers[REPO_REV_HEADER] +export const getRepoRev = (headers?: HeadersMap): string | undefined => { + return headers?.[REPO_REV_HEADER] } export const getLocalLag = (local: LocalRecords): number | undefined => {