1
0
mirror of https://github.com/trambarhq/relaks-wordpress-example.git synced 2025-09-02 12:42:38 +02:00

Added fixed for errant < (issue #27).

This commit is contained in:
Chung Leong
2019-01-28 11:51:09 +01:00
parent 16d399793b
commit eaaa5f632e
2 changed files with 5 additions and 0 deletions

View File

@@ -51,6 +51,9 @@ async function handleJSONRequest(req, res, next) {
try {
let path = `/wp-json/${req.url.substr(6)}`;
let json = await JSONRetriever.fetch(path);
if (json.total) {
res.set({ 'X-WP-Total': json.total });
}
res.send(json.text);
} catch (err) {
next(err);