mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix: allow ports in wildcard url configuration (#11657)
* fix: allow ports in wildcard url configuration This just forwards the port to the ui that generates urls. Our existing parsing + regex already supported ports for subdomain app requests.
This commit is contained in:
@@ -3,7 +3,6 @@ package coderd
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strings"
|
||||
@@ -32,13 +31,8 @@ import (
|
||||
// @Router /applications/host [get]
|
||||
// @Deprecated use api/v2/regions and see the primary proxy.
|
||||
func (api *API) appHost(rw http.ResponseWriter, r *http.Request) {
|
||||
host := api.AppHostname
|
||||
if host != "" && api.AccessURL.Port() != "" {
|
||||
host += fmt.Sprintf(":%s", api.AccessURL.Port())
|
||||
}
|
||||
|
||||
httpapi.Write(r.Context(), rw, http.StatusOK, codersdk.AppHostResponse{
|
||||
Host: host,
|
||||
Host: appurl.SubdomainAppHost(api.AppHostname, api.AccessURL),
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user