Almaatla commited on
Commit
2657305
·
verified ·
1 Parent(s): 2687a93

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -310,14 +310,15 @@ async def get_proxy():
310
  addMessageEntry('incoming', msg.source, 'proxy', msg.content);
311
  document.getElementById('detailedStatus').textContent = `Processing ${msg.source} request...`;
312
  // check if incoming call has the correct key
313
- const expected_incoming_key = document.getElementById('incomingKey');
314
- if (msg.incomingKey != expected_incoming_key){
315
- return {
316
- request_id: msg.request_id, // Critical addition
317
- content: "Error: Incoming Authentication Key incorrect!",
318
  source: 'proxy',
319
  destination: msg.source
320
- };
 
321
  }
322
 
323
  try {
 
310
  addMessageEntry('incoming', msg.source, 'proxy', msg.content);
311
  document.getElementById('detailedStatus').textContent = `Processing ${msg.source} request...`;
312
  // check if incoming call has the correct key
313
+ const expectedKey = document.getElementById('incomingKey').value;
314
+ if (!msg.incomingKey || msg.incomingKey !== expectedKey) {
315
+ ws.send(JSON.stringify({
316
+ request_id: msg.request_id,
317
+ content: "Error: Invalid authentication",
318
  source: 'proxy',
319
  destination: msg.source
320
+ }));
321
+ return;
322
  }
323
 
324
  try {