@taskforcehq/taskforce 0.3.317 → 0.3.318

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -41,6 +41,7 @@ export declare function writeJsonErrorIfPossible(res: http.ServerResponse, statu
41
41
  export declare function applyCloudProxyForwardedHeaders(headers: Headers, req: http.IncomingMessage): void;
42
42
  export declare function rewriteProxySetCookieForLocalHost(cookie: string): string;
43
43
  export declare function shouldRewriteProxySetCookieDomain(cookie: string, hostHeader: string | undefined): boolean;
44
+ export declare function shouldForwardCloudProxyResponseHeader(name: string): boolean;
44
45
  export declare function shouldApplyAuthRateLimitForPath(pathname: string): boolean;
45
46
  export declare function resolveCloudProxyBaseUrl(env?: NodeJS.ProcessEnv): string;
46
47
  export declare function ensureBillingWebhookAuthExclusion(excludedPaths: string[]): string[];
@@ -84,6 +84,10 @@ const CORS_RESPONSE_HEADERS = new Set([
84
84
  'access-control-max-age',
85
85
  'vary'
86
86
  ]);
87
+ const CLOUD_PROXY_BODY_HEADERS = new Set([
88
+ 'content-encoding',
89
+ 'content-length'
90
+ ]);
87
91
  const REFRESH_DIAGNOSTIC_PATH_PREFIXES = [
88
92
  '/api/taskforce/auth/session',
89
93
  '/api/taskforce/config',
@@ -337,6 +341,18 @@ export function shouldRewriteProxySetCookieDomain(cookie, hostHeader) {
337
341
  return false;
338
342
  return !requestHost.endsWith(`.${cookieDomain}`);
339
343
  }
344
+ export function shouldForwardCloudProxyResponseHeader(name) {
345
+ const normalizedName = String(name || '').trim().toLowerCase();
346
+ if (!normalizedName)
347
+ return false;
348
+ if (HOP_BY_HOP_HEADERS.has(normalizedName))
349
+ return false;
350
+ if (CORS_RESPONSE_HEADERS.has(normalizedName))
351
+ return false;
352
+ if (CLOUD_PROXY_BODY_HEADERS.has(normalizedName))
353
+ return false;
354
+ return normalizedName !== 'set-cookie';
355
+ }
340
356
  async function readRequestBody(req, maxBytes) {
341
357
  const chunks = [];
342
358
  let total = 0;
@@ -685,12 +701,7 @@ export function createStandaloneServer(options) {
685
701
  });
686
702
  const outgoingHeaders = {};
687
703
  for (const [key, value] of upstream.headers.entries()) {
688
- const name = key.toLowerCase();
689
- if (HOP_BY_HOP_HEADERS.has(name))
690
- continue;
691
- if (CORS_RESPONSE_HEADERS.has(name))
692
- continue;
693
- if (name === 'set-cookie')
704
+ if (!shouldForwardCloudProxyResponseHeader(key))
694
705
  continue;
695
706
  outgoingHeaders[key] = value;
696
707
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taskforcehq/taskforce",
3
- "version": "0.3.317",
3
+ "version": "0.3.318",
4
4
  "description": "Shared task and planning workspace for humans collaborating with AI (public beta)",
5
5
  "author": "Taskforce HQ <hello@taskforcehq.ai> (https://taskforcehq.ai)",
6
6
  "license": "MIT",