mirror of
https://github.com/pcvolkmer/idicon.git
synced 2025-07-02 03:42:54 +00:00
Add redirect param to user config
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user