Skip to content

Commit

Permalink
Fix fastjson overwriting old parsed json
Browse files Browse the repository at this point in the history
Should fixed "Post not available" when it is available in embed
  • Loading branch information
Wikidepia committed Nov 28, 2023
1 parent acea4b5 commit d967c4d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions handlers/data/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit d967c4d

Please sign in to comment.