mirror of
https://github.com/httpjamesm/AnonymousOverflow.git
synced 2025-06-06 14:50:19 +00:00
feat: allow stackoverflow.com/q/ in posthome (#66)
This commit is contained in:
parent
cf89be2a48
commit
16828585ac
1 changed files with 1 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue