Fix typo and formatting (#2028)

This commit is contained in:
Vinoth Kumar 2024-08-30 13:24:45 +05:30 committed by GitHub
parent 1819480153
commit d7fe13c4b9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 9 additions and 10 deletions

View file

@ -72,8 +72,8 @@ func initHTTPHandlers(e *echo.Echo, app *App) {
}) })
g.GET(path.Join(adminRoot, ""), handleAdminPage) g.GET(path.Join(adminRoot, ""), handleAdminPage)
g.GET(path.Join(adminRoot, "/custom.css"), serveCustomApperance("admin.custom_css")) g.GET(path.Join(adminRoot, "/custom.css"), serveCustomAppearance("admin.custom_css"))
g.GET(path.Join(adminRoot, "/custom.js"), serveCustomApperance("admin.custom_js")) g.GET(path.Join(adminRoot, "/custom.js"), serveCustomAppearance("admin.custom_js"))
g.GET(path.Join(adminRoot, "/*"), handleAdminPage) g.GET(path.Join(adminRoot, "/*"), handleAdminPage)
// API endpoints. // API endpoints.
@ -210,8 +210,8 @@ func initHTTPHandlers(e *echo.Echo, app *App) {
e.GET("/archive/latest", handleCampaignArchivePageLatest) e.GET("/archive/latest", handleCampaignArchivePageLatest)
} }
e.GET("/public/custom.css", serveCustomApperance("public.custom_css")) e.GET("/public/custom.css", serveCustomAppearance("public.custom_css"))
e.GET("/public/custom.js", serveCustomApperance("public.custom_js")) e.GET("/public/custom.js", serveCustomAppearance("public.custom_js"))
// Public health API endpoint. // Public health API endpoint.
e.GET("/health", handleHealthCheck) e.GET("/health", handleHealthCheck)
@ -248,9 +248,9 @@ func handleHealthCheck(c echo.Context) error {
return c.JSON(http.StatusOK, okResp{true}) return c.JSON(http.StatusOK, okResp{true})
} }
// serveCustomApperance serves the given custom CSS/JS appearance blob // serveCustomAppearance serves the given custom CSS/JS appearance blob
// meant for customizing public and admin pages from the admin settings UI. // meant for customizing public and admin pages from the admin settings UI.
func serveCustomApperance(name string) echo.HandlerFunc { func serveCustomAppearance(name string) echo.HandlerFunc {
return func(c echo.Context) error { return func(c echo.Context) error {
var ( var (
app = c.Get("app").(*App) app = c.Get("app").(*App)

View file

@ -3,8 +3,8 @@ package main
import ( import (
"encoding/json" "encoding/json"
"io" "io"
"os"
"net/http" "net/http"
"os"
"strings" "strings"
"github.com/knadh/listmonk/internal/subimporter" "github.com/knadh/listmonk/internal/subimporter"

View file

@ -1,7 +1,6 @@
package core package core
import ( import (
"fmt"
"net/http" "net/http"
"strings" "strings"

View file

@ -155,7 +155,7 @@ func (e *Emailer) Push(m models.Message) error {
em.Bcc = append(em.Bcc, strings.TrimSpace(part)) em.Bcc = append(em.Bcc, strings.TrimSpace(part))
} }
em.Headers.Del(hdrBcc) em.Headers.Del(hdrBcc)
} }
// If the `Cc` header is set, it should be set on the Envelope // If the `Cc` header is set, it should be set on the Envelope
if cc := em.Headers.Get(hdrCc); cc != "" { if cc := em.Headers.Get(hdrCc); cc != "" {
@ -163,7 +163,7 @@ func (e *Emailer) Push(m models.Message) error {
em.Cc = append(em.Cc, strings.TrimSpace(part)) em.Cc = append(em.Cc, strings.TrimSpace(part))
} }
em.Headers.Del(hdrCc) em.Headers.Del(hdrCc)
} }
switch m.ContentType { switch m.ContentType {
case "plain": case "plain":