mirror of
https://github.com/Nathanwoodburn/hnschat-web.git
synced 2025-12-06 08:42:59 +11:00
fix: Use dynamically generated upload url
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user