enable custom headers for feeds (allow fetch from remote sites)
1 file changed, 8 insertions(+), 0 deletions(-)
changed files
M internal/builder/builder.go → internal/builder/builder.go
@@ -24,6 +24,12 @@ "github.com/Southclaws/fault/fmsg" mapset "github.com/deckarep/golang-set/v2" ) +var feedHeaders = map[string]string{ + "Access-Control-Allow-Origin": "*", + "Access-Control-Allow-Methods": "GET, OPTIONS", + "Access-Control-Max-Age": "3600", +} + type Options struct { Source string `conf:"default:.,short:s,flag:src"` Development bool `conf:"default:false,flag:dev"`@@ -156,6 +162,7 @@ file := &storage.File{ Title: title, LastModified: matchingPosts[0].Date, ContentType: "application/xml", + Headers: feedHeaders, Path: path.Join("/tags", tag, "atom.xml"), FSPath: path.Join("/tags", tag, "atom.xml"), }@@ -189,6 +196,7 @@ file := &storage.File{ Title: config.Title, LastModified: cc.Posts[0].Date, ContentType: "application/xml", + Headers: feedHeaders, Path: "/atom.xml", FSPath: "/atom.xml", }