Skip to content

Commit 8476689

Browse files
committed
feat: improve security by enabling CORS with trusted origins
1 parent 718ea49 commit 8476689

3 files changed

Lines changed: 76 additions & 74 deletions

File tree

zclient/chat-init.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ document.addEventListener('DOMContentLoaded', () => {
2020
if (chat_interface) {
2121
return chat_interface;
2222
}
23-
chat_interface = new ChatInterface('', 'nlwebsearch', 'list');
23+
chat_interface = new ChatInterface('', 'nlwebsearch', 'list', '/ask');
2424
return chat_interface;
2525
}
2626

2727
function handleSearch() {
2828
const query = searchInput.value.trim();
29-
29+
3030
chatContainer.style.display = 'block';
3131
chat_interface = findChatInterface();
3232
searchInput.value = '';
3333
chat_interface.sendMessage(query);
3434
}
35-
});
35+
});

zclient/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
</div>
3232

3333
<script type="module">
34-
import { ChatInterface } from 'remoteStreaming.js';
34+
import { ChatInterface } from './remoteStreaming.js';
3535

3636
// Single global chat interface
3737
let chat_interface = null;
@@ -53,7 +53,7 @@
5353
if (chat_interface) {
5454
return chat_interface;
5555
}
56-
chat_interface = new ChatInterface('', 'nlwebsearch', 'generate');
56+
chat_interface = new ChatInterface('', 'nlwebsearch', 'generate', 'http://localhost:8000/ask');
5757
return chat_interface;
5858
}
5959

0 commit comments

Comments
 (0)