Skip to content

Commit 7e62de3

Browse files
gabbygator184KoalaSat
authored andcommitted
Fix CR in auth header
Normalize Windows CRLF line endings out of the serialized PGP public/private key segments in the robot Authorization header. Raw carriage-return characters produce an HTTP-invalid header value, causing window.fetch to throw TypeError: invalid header value on every authenticated request (web, desktop, and Android). Switching from split('\n').join('\\') to replace(/[\r\n]+/g, '\\') strips both CR and LF before they ever reach the header, while preserving the backslash-separated key contract expected by the coordinator (api/utils.py).
1 parent f768a54 commit 7e62de3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

frontend/src/models/Robot.model.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ class Robot {
4444
tokenSHA256,
4545
nostrPubkey,
4646
keys: {
47-
pubKey: pubKey.split('\n').join('\\'),
48-
encPrivKey: encPrivKey.split('\n').join('\\'),
47+
pubKey: pubKey.replace(/[\r\n]+/g, '\\'),
48+
encPrivKey: encPrivKey.replace(/[\r\n]+/g, '\\'),
4949
},
5050
};
5151
};

0 commit comments

Comments
 (0)