diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-09-06 10:16:31 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-09-06 10:16:33 +0900 |
| commit | abb9d17e79405cbee8bb98887b457d2a7e215ba9 (patch) | |
| tree | 85dd6645cda1740c51234f292fc2a7d9bb32e880 /backend | |
| parent | 3e77bb9ee1aabab22138de9850d8bd434eda6d91 (diff) | |
| download | iosdc-japan-2025-albatross-abb9d17e79405cbee8bb98887b457d2a7e215ba9.tar.gz iosdc-japan-2025-albatross-abb9d17e79405cbee8bb98887b457d2a7e215ba9.tar.zst iosdc-japan-2025-albatross-abb9d17e79405cbee8bb98887b457d2a7e215ba9.zip | |
fix(backend): duplicate slashes in some URLs
Diffstat (limited to 'backend')
| -rw-r--r-- | backend/account/icon.go | 4 | ||||
| -rw-r--r-- | backend/admin/templates/games.html | 6 | ||||
| -rw-r--r-- | backend/admin/templates/users.html | 4 |
3 files changed, 7 insertions, 7 deletions
diff --git a/backend/account/icon.go b/backend/account/icon.go index 4f195c6..9e5e379 100644 --- a/backend/account/icon.go +++ b/backend/account/icon.go @@ -34,8 +34,8 @@ func FetchIcon( return fmt.Errorf("failed to fetch user icon (uid=%d): %w", userID, err) } // Download user icon file. - filePath := fmt.Sprintf("/files/img/%s/icon%s", url.PathEscape(user.Username), path.Ext(avatarURL)) - if err := downloadFile(ctx, fortee.Endpoint+avatarURL, "/data"+filePath); err != nil { + filePath := fmt.Sprintf("files/img/%s/icon%s", url.PathEscape(user.Username), path.Ext(avatarURL)) + if err := downloadFile(ctx, fortee.Endpoint+avatarURL, "/data/"+filePath); err != nil { return fmt.Errorf("failed to fetch user icon (uid=%d): %w", userID, err) } // Save user icon path. diff --git a/backend/admin/templates/games.html b/backend/admin/templates/games.html index 402c702..d642f07 100644 --- a/backend/admin/templates/games.html +++ b/backend/admin/templates/games.html @@ -11,15 +11,15 @@ <ul> {{ range .Games }} <li> - <a href="{{ $.BasePath }}/admin/games/{{ .GameID }}"> + <a href="{{ $.BasePath }}admin/games/{{ .GameID }}"> {{ .DisplayName }} (id={{ .GameID }} type={{ .GameType }} {{ if not .IsPublic }}private{{ end }}) </a> <ul> {{ if .IsPublic }} - <li><a href="{{ $.BasePath }}/golf/{{ .GameID }}/play">Play</a></li> + <li><a href="{{ $.BasePath }}golf/{{ .GameID }}/play">Play</a></li> {{ end }} {{ if .IsPublic }} - <li><a href="{{ $.BasePath }}/golf/{{ .GameID }}/watch">Watch</a></li> + <li><a href="{{ $.BasePath }}golf/{{ .GameID }}/watch">Watch</a></li> {{ end }} </ul> </li> diff --git a/backend/admin/templates/users.html b/backend/admin/templates/users.html index 4b8e6dc..39ec589 100644 --- a/backend/admin/templates/users.html +++ b/backend/admin/templates/users.html @@ -8,10 +8,10 @@ <ul> {{ range .Users }} <li> - <a href="{{ $.BasePath }}/admin/users/{{ .UserID }}"> + <a href="{{ $.BasePath }}admin/users/{{ .UserID }}"> {{ .DisplayName }} (id={{ .UserID }} username={{ .Username }}){{ if .IsAdmin }} <em>admin</em>{{ end }} </a> - <form method="post" action="{{ $.BasePath }}/admin/users/{{ .UserID }}/fetch-icon"> + <form method="post" action="{{ $.BasePath }}admin/users/{{ .UserID }}/fetch-icon"> <button type="submit">Fetch Icon</button> </form> </li> |
