feat(frontend): don't assume secure protocol for kyros websocket/fs (#6420)

* feat(frontend): don't assume https as websocket/fs protocol

* fix(frontend): actually do the same for websocket

* fix(frontend): don't strip ws path
This commit is contained in:
François-Xavier Talbot
2026-06-16 21:39:38 +00:00
committed by GitHub
parent 8591bc8ebc
commit 5ed322d281
4 changed files with 18 additions and 3 deletions
@@ -1,6 +1,7 @@
import { AbstractFeature, type FeatureConfig } from '../core/abstract-feature'
import { ModrinthApiError } from '../core/errors'
import type { RequestContext } from '../types/request'
import { getNodeBaseUrl } from '../utils/node-url'
/**
* Node authentication credentials
@@ -107,7 +108,7 @@ export class NodeAuthFeature extends AbstractFeature {
}
private applyAuth(context: RequestContext, auth: NodeAuth): void {
const baseUrl = `https://${auth.url.replace(/\/modrinth\/v\d+\/fs\/?$/, '')}`
const baseUrl = getNodeBaseUrl(auth.url)
context.url = this.buildUrl(context.path, baseUrl, context.options.version)
context.options.headers = {