Add redirect param to user config

This commit is contained in:
2023-09-03 09:41:00 +02:00
parent ec33b402b9
commit 80cbf9210d
4 changed files with 31 additions and 0 deletions

View File

@ -33,6 +33,12 @@ func requestHandler(w http.ResponseWriter, r *http.Request) {
for _, userConfig := range config.Users {
if icons.HashBytes(id) == icons.HashBytes(userConfig.ID) {
if userConfig.Redirect != "" {
w.Header().Add("Location", userConfig.Redirect)
w.WriteHeader(http.StatusFound)
return
}
id = userConfig.Alias
if len(userConfig.ColorScheme) > 0 {
colorScheme = userConfig.ColorScheme