From f4257a5be85625639abd5016e9e5bc867085ddfe Mon Sep 17 00:00:00 2001 From: "Shin (Former Aleph)" <67456590+therealaleph@users.noreply.github.com> Date: Sun, 17 May 2026 19:47:10 +0300 Subject: [PATCH] fix(apps_script): keep Code.gs relay responses wrapped (#1265) Fix the v1.9.28 Code.gs JSON parse regression by keeping normal relay responses wrapped and using req.r only for redirect handling.\n\nTests:\n- node --check /tmp/Code-1265-fix.js\n- cargo test --lib --- assets/apps_script/Code.gs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/assets/apps_script/Code.gs b/assets/apps_script/Code.gs index 1b1972a..9403bba 100644 --- a/assets/apps_script/Code.gs +++ b/assets/apps_script/Code.gs @@ -203,14 +203,6 @@ function _doSingle(req) { var opts = _buildOpts(req); var resp = UrlFetchApp.fetch(req.u, opts); - // Raw-return mode for exit-node path. - // r:true = return destination body verbatim so Rust gets {s,h,b} unwrapped. - if (req.r === true) { - return ContentService - .createTextOutput(resp.getContentText()) - .setMimeType(ContentService.MimeType.JSON); - } - return _json({ s: resp.getResponseCode(), h: _respHeaders(resp), @@ -316,7 +308,7 @@ function _buildOpts(req) { var opts = { method: (req.m || "GET").toLowerCase(), muteHttpExceptions: true, - followRedirects: true, // ← always true; r flag now has different meaning + followRedirects: req.r !== false, validateHttpsCertificates: true, escaping: false, };