Add pwi as interest header for PWI

This commit is contained in:
Eric Bailey
2024-10-18 10:46:30 -05:00
parent fd2e94f353
commit 35e98401b9
+8 -7
View File
@@ -108,11 +108,12 @@ async function loggedOutFetch({
}) { }) {
let contentLangs = getAppLanguageAsContentLanguage() let contentLangs = getAppLanguageAsContentLanguage()
/** const headers = {
* Copied from our root `Agent` class 'x-bsky-topics': 'pwi',
* @see https://github.com/bluesky-social/atproto/blob/60df3fc652b00cdff71dd9235d98a7a4bb828f05/packages/api/src/agent.ts#L120 /**
*/ * Copied from our root `Agent` class
const labelersHeader = { * @see https://github.com/bluesky-social/atproto/blob/60df3fc652b00cdff71dd9235d98a7a4bb828f05/packages/api/src/agent.ts#L120
*/
'atproto-accept-labelers': BskyAgent.appLabelers 'atproto-accept-labelers': BskyAgent.appLabelers
.map(l => `${l};redact`) .map(l => `${l};redact`)
.join(', '), .join(', '),
@@ -125,7 +126,7 @@ async function loggedOutFetch({
}&limit=${limit}&lang=${contentLangs}`, }&limit=${limit}&lang=${contentLangs}`,
{ {
method: 'GET', method: 'GET',
headers: {'Accept-Language': contentLangs, ...labelersHeader}, headers: {'Accept-Language': contentLangs, ...headers},
}, },
) )
let data = res.ok ? jsonStringToLex(await res.text()) : null let data = res.ok ? jsonStringToLex(await res.text()) : null
@@ -141,7 +142,7 @@ async function loggedOutFetch({
`https://api.bsky.app/xrpc/app.bsky.feed.getFeed?feed=${feed}${ `https://api.bsky.app/xrpc/app.bsky.feed.getFeed?feed=${feed}${
cursor ? `&cursor=${cursor}` : '' cursor ? `&cursor=${cursor}` : ''
}&limit=${limit}`, }&limit=${limit}`,
{method: 'GET', headers: {'Accept-Language': '', ...labelersHeader}}, {method: 'GET', headers: {'Accept-Language': '', ...headers}},
) )
data = res.ok ? jsonStringToLex(await res.text()) : null data = res.ok ? jsonStringToLex(await res.text()) : null
if (data?.feed?.length) { if (data?.feed?.length) {