summaryrefslogtreecommitdiff
path: root/internal/web
diff options
context:
space:
mode:
Diffstat (limited to 'internal/web')
-rw-r--r--internal/web/base.go8
-rw-r--r--internal/web/profile.go1
2 files changed, 8 insertions, 1 deletions
diff --git a/internal/web/base.go b/internal/web/base.go
index 61b4634ed..0dae30772 100644
--- a/internal/web/base.go
+++ b/internal/web/base.go
@@ -20,6 +20,7 @@ package web
import (
"net/http"
+ "strings"
"github.com/gin-gonic/gin"
"github.com/superseriousbusiness/gotosocial/internal/api"
@@ -28,6 +29,13 @@ import (
)
func (m *Module) baseHandler(c *gin.Context) {
+
+ // if a landingPageUser is set in the config, redirect to that user's profile
+ if landingPageUser := config.GetLandingPageUser(); landingPageUser != "" {
+ c.Redirect(http.StatusFound, "/@"+c.Param(strings.ToLower(landingPageUser)))
+ return
+ }
+
host := config.GetHost()
instance, err := m.processor.InstanceGet(c.Request.Context(), host)
if err != nil {
diff --git a/internal/web/profile.go b/internal/web/profile.go
index 27de99e13..5023fa238 100644
--- a/internal/web/profile.go
+++ b/internal/web/profile.go
@@ -49,7 +49,6 @@ func (m *Module) profileGETHandler(c *gin.Context) {
return
}
- // usernames on our instance will always be lowercase
username := strings.ToLower(c.Param(usernameKey))
if username == "" {
err := errors.New("no account username specified")