fix: Use dynamically generated upload url

This commit is contained in:
Nathan Woodburn 2025-03-13 19:26:24 +11:00
parent 282e54e4e2
commit be885c3f65
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1
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";

View File

@ -9,20 +9,4 @@
<?php
include "etc/page/chat.php";
?>
<script>
var _paq = window._paq = window._paq || [];
_paq.push(["setCookieDomain", "*.hns.chat"]);
_paq.push(["setDomains", ["*.hns.chat","*.hnschat"]]);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="https://35k1m0.com/trkr/";
_paq.push(['setTrackerUrl', u+'trkr.php']);
_paq.push(['setSiteId', '13']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.async=true; g.src=u+'trkr.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<noscript><p><img src="https://35k1m0.com/trkr/trkr.php?idsite=13&amp;rec=1" style="border:0;" alt="" /></p></noscript>
<script async src="https://trkr.35k1m0.com/script.js" data-website-id="38ec710a-a492-4465-a2ba-292eb4b645a5"></script>
</html>