fix: admin/internet: wrong message mapping ports

Massimo Melina committed Jul 5, 2025 at 19:13 UTC ea4f0d5b958de6facf2be36a49999c534f92e1a4
2 files changed +2 -2
admin/src/InternetPage.ts
+1 -1
@@ -441,7 +441,7 @@ export default function InternetPage({ setTitleSide }: PageProps) {
441 }
442 catch(e: any) {
443 if (errMsg) {
444 - const low = external && Math.min(external, data!.internalPort!) < 1024
444 + const low = (external || data!.internalPort!) < 1024
445 const msg = errMsg + prefix(': ', e?.message) + (low ? ". Some routers refuse to work with ports under 1024." : '')
446 await alertDialog(msg, 'error')
447 }
src/api.net.ts
+1 -1
@@ -54,7 +54,7 @@ const apis: ApiHandlers = {
54 if (external) // must use the object form of 'public' to work around a bug of the library
55 await upnpClient.createMapping({ private: internal || internalPort, public: { host: '', port: external }, description: 'hfs', ttl: 0 })
56 .catch(res => {
57 - throw new ApiError(res.errorCode || res.statusCode, res.errorCode === 718 ? "Port not available" : res.errorDescription || "unknown error")
57 + throw new ApiError(res.errorCode || HTTP_SERVER_ERROR, res.errorCode === 718 ? "Port not available" : res.errorDescription || "unknown error")
58 })
59 return {}
60 },