From e3d60d4d3e6a35e02fdd69662935f86949f35c4e Mon Sep 17 00:00:00 2001 From: httpjamesm Date: Thu, 28 Sep 2023 13:53:34 -0400 Subject: [PATCH] feat: allow stackoverflow.com/q/ in posthome --- src/routes/home.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/home.go b/src/routes/home.go index 27b511a..306d41c 100644 --- a/src/routes/home.go +++ b/src/routes/home.go @@ -40,7 +40,7 @@ func PostHome(c *gin.Context) { // validate URL isStackOverflow := strings.HasPrefix(soLink, "https://stackoverflow.com/questions/") - isShortenedStackOverflow := strings.HasPrefix(soLink, "https://stackoverflow.com/a/") + isShortenedStackOverflow := strings.HasPrefix(soLink, "https://stackoverflow.com/a/") || strings.HasPrefix(soLink, "https://stackoverflow.com/q/") isStackExchange := stackExchangeRegex.MatchString(soLink) if !isStackExchange && !isStackOverflow && !isShortenedStackOverflow { c.HTML(400, "home.html", gin.H{