minor improvements
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
Accept <a href="/TOS.md">Terms of Service</a>
|
||||
</label>
|
||||
<div id="captcha" class="g-recaptcha" data-sitekey="6LemnDEUAAAAAC6A4VNRefz0BSLiC343W4sXQd6I"></div>
|
||||
<input class="button ui-elem" disabled id="publish-button" name="button" type="submit" value="Publish" />
|
||||
<input class="button ui-elem" disabled id="publish-button" name="button" type="submit" value="Publish Note" />
|
||||
</fieldset>
|
||||
</form>
|
||||
<footer>
|
||||
|
||||
@@ -10,7 +10,7 @@ func email(id, text string) error {
|
||||
smtpServer := os.Getenv("SMTP_SERVER")
|
||||
auth := smtp.PlainAuth("", os.Getenv("SMTP_USER"), os.Getenv("SMTP_PASSWORD"), smtpServer)
|
||||
to := []string{os.Getenv("NOTEHUB_ADMIN_EMAIL")}
|
||||
msg := []byte("Subject: note reported\r\n\r\n" +
|
||||
msg := []byte("Subject: Note reported\r\n\r\n" +
|
||||
fmt.Sprintf("Note https://notehub.org/%s was reported: %q\r\n", id, text))
|
||||
return smtp.SendMail(smtpServer+":587", auth, to[0], to, msg)
|
||||
}
|
||||
|
||||
@@ -107,7 +107,6 @@ func main() {
|
||||
e.POST("/note", func(c echo.Context) error {
|
||||
c.Logger().Debug("POST /note requested")
|
||||
if !skipCaptcha && !checkRecaptcha(c, c.FormValue("g-recaptcha-response")) {
|
||||
c.Logger().Warnf("captcha validation failed for %s", c.Request().RemoteAddr)
|
||||
code := http.StatusForbidden
|
||||
return c.Render(code, "Note", responsePage(code))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user