Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
soundofspace committed Jan 9, 2025
1 parent 56d621b commit 470a3f4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion agent/main/lib/Agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default class Agent extends TypedEventEmitter<{ close: void }> {

// We use secretKey all through Agent components to make sure websites can't test if hero is present.
// Without this secretKey if would be pretty easy to detect hero.
private secretKey = crypto.randomUUID();
private secretKey = nanoid();

private get proxyConnectionInfo(): IProxyConnectionOptions {
if (!this.enableMitm) {
Expand Down
2 changes: 1 addition & 1 deletion agent/main/lib/Console.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export class Console extends TypedEventEmitter<IConsoleEvents> {
try {
// Doing this is much much cheaper than json parse on everything logged in console debug
const text = msgAdded.message.text;
const [secret, maybeClientId, serializedData] = [text.slice(0,36), text.slice(38,48), text.slice(50)];
const [secret, maybeClientId, serializedData] = [text.slice(0,21), text.slice(23,33), text.slice(35)];
if (secret !== this.secretKey) return;

const data = JSON.parse(serializedData);
Expand Down

0 comments on commit 470a3f4

Please sign in to comment.