Skip to content

Commit

Permalink
Remove uneeded ports from tunnel domain url when they are default
Browse files Browse the repository at this point in the history
  • Loading branch information
NHAS committed Nov 29, 2024
1 parent e6f3728 commit 0469808
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion adminui/frontend/src/api/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export interface UsersGetAllResponseDTO {
export enum UserEditActions {
Lock = 'lock',
Unlock = 'unlock',
RestMFA = 'resetMFA'
ResetMFA = 'resetMFA'
}

export interface EditUsersDTO {
Expand Down
2 changes: 1 addition & 1 deletion adminui/frontend/src/pages/Users.vue
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ const selectedUsersHasLocked = computed(() => {
</button>
</div>
<div class="tooltip" :data-tip="'Reset ' + selectedUsers.length + ' users MFA'">
<button @click="updateUser(selectedUsers, UserEditActions.RestMFA)" class="btn btn-ghost btn-primary">
<button @click="updateUser(selectedUsers, UserEditActions.ResetMFA)" class="btn btn-ghost btn-primary">
Reset MFA <font-awesome-icon :icon="Icons.Refresh" />
</button>
</div>
Expand Down
2 changes: 1 addition & 1 deletion internal/data/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ func GetTunnelDomainUrl() (string, error) {

url := scheme + details.Domain
_, port, err := net.SplitHostPort(details.ListenAddress)
if err == nil {
if err == nil && ((scheme == "http://" && port != "80") || (scheme == "https://" && port != "443")) {
url = url + ":" + port
}

Expand Down
2 changes: 1 addition & 1 deletion internal/router/session_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ func (c *Challenger) WS(w http.ResponseWriter, r *http.Request) {
// Upgrade HTTP connection to WebSocket connection
_c, err := c.upgrader.Upgrade(w, r, nil)
if err != nil {
log.Println(user.Username, remoteAddress, "failed to create websocket challenger:", err)
log.Println(user.Username, remoteAddress, "failed to create websocket:", err)
http.Error(w, "Server Error", http.StatusInternalServerError)
return
}
Expand Down

0 comments on commit 0469808

Please sign in to comment.