feat: allow stackoverflow.com/q/ in posthome (#66)
This commit is contained in:
parent
cf89be2a48
commit
16828585ac
@ -40,7 +40,7 @@ func PostHome(c *gin.Context) {
|
|||||||
|
|
||||||
// validate URL
|
// validate URL
|
||||||
isStackOverflow := strings.HasPrefix(soLink, "https://stackoverflow.com/questions/")
|
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)
|
isStackExchange := stackExchangeRegex.MatchString(soLink)
|
||||||
if !isStackExchange && !isStackOverflow && !isShortenedStackOverflow {
|
if !isStackExchange && !isStackOverflow && !isShortenedStackOverflow {
|
||||||
c.HTML(400, "home.html", gin.H{
|
c.HTML(400, "home.html", gin.H{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user