Compare commits

...

1 Commits

Author SHA1 Message Date
httpjamesm e3d60d4d3e feat: allow stackoverflow.com/q/ in posthome 2023-09-28 13:53:34 -04:00
+1 -1
View File
@@ -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{