Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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
|
| 314 |
-
if (msg.incomingKey
|
| 315 |
-
|
| 316 |
-
request_id: msg.request_id,
|
| 317 |
-
content: "Error:
|
| 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 {
|