atproto pds in zig pds.zat.dev
pds atproto
24

Configure Feed

Select the types of activity you want to include in your feed.

Preserve proxy headers before body reads

zzstoatzz (May 22, 2026, 4:34 PM -0500) 9a0e434e b6857196

+10 -9
+10 -9
src/atproto/proxy.zig
··· 61 61 }; 62 62 log.debug("xrpc proxy auth ok method={s} account={s} service_did={s} endpoint={s}\n", .{ method, account.did, service.did, service.endpoint }); 63 63 const upstream_url = try std.fmt.allocPrint(allocator, "{s}{s}", .{ service.endpoint, request.head.target }); 64 + 65 + var extra_buf: [6]std.http.Header = undefined; 66 + var extra_count: usize = 0; 67 + inline for (.{ "accept-language", "atproto-accept-labelers", "atproto-content-labelers", "x-bsky-topics", "dpop" }) |name| { 68 + if (http_api.headerValue(request, name)) |value| { 69 + extra_buf[extra_count] = .{ .name = name, .value = try allocator.dupe(u8, value) }; 70 + extra_count += 1; 71 + } 72 + } 73 + 64 74 const payload = if (request.head.method == .POST) 65 75 try http_api.readBodyAlloc(request, allocator, 1024 * 1024) 66 76 else ··· 98 108 }; 99 109 const service_token = try auth.createServiceJwtWithKeypair(allocator, account, service_audience, service_method, &keypair); 100 110 const authorization = try std.fmt.allocPrint(allocator, "Bearer {s}", .{service_token}); 101 - 102 - var extra_buf: [6]std.http.Header = undefined; 103 - var extra_count: usize = 0; 104 - inline for (.{ "accept-language", "atproto-accept-labelers", "atproto-content-labelers", "x-bsky-topics", "dpop" }) |name| { 105 - if (http_api.headerValue(request, name)) |value| { 106 - extra_buf[extra_count] = .{ .name = name, .value = value }; 107 - extra_count += 1; 108 - } 109 - } 110 111 111 112 var transport = zat.HttpTransport.init(store.currentIo(), allocator); 112 113 defer transport.deinit();