fix: Use dynamically generated upload url

This commit is contained in:
2025-03-13 19:26:24 +11:00
parent 282e54e4e2
commit be885c3f65
3 changed files with 2 additions and 17 deletions

View File

@@ -1352,7 +1352,7 @@ export class HNSChat {
async upload(data, attachment) {
let output = new Promise(resolve => {
$.ajax({
url: "https://hns.chat/upload",
url: `${window.location.origin}/upload`,
type: "POST",
data: data,
cache: false,

View File

@@ -1680,6 +1680,7 @@ export class ui {
switch (url.host) {
case "hns.chat":
case "hnschat":
case window.location.host:
match = url.pathname.match(/^(\/uploads\/.{32}|\/avatar\/.{16})$/);
if (match) {
return "image";