From d967c4daf069057e6758d981c406bbe483ef5e9e Mon Sep 17 00:00:00 2001 From: Akmal Date: Tue, 28 Nov 2023 17:12:54 +0700 Subject: [PATCH] Fix fastjson overwriting old parsed json Should fixed "Post not available" when it is available in embed --- handlers/data/data.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/handlers/data/data.go b/handlers/data/data.go index 9e5bac7..6555690 100644 --- a/handlers/data/data.go +++ b/handlers/data/data.go @@ -226,6 +226,8 @@ func getData(postID string, p *fastjson.Parser) (*fastjson.Value, error) { return nil, ErrNotFound } + // Need to re-parse as fastjson do weird stuff idk + embedHTMLData, _ = p.ParseBytes(embedHTML) log.Info().Str("postID", postID).Msg("Data parsed from ParseEmbedHTML") return embedHTMLData, nil }