@mediarithmics/plugins-nodejs-sdk
Advanced tools
Comparing version 0.3.7 to 0.3.8
@@ -12,2 +12,3 @@ "use strict"; | ||
const _ = require("lodash"); | ||
const jsesc = require("jsesc"); | ||
const index_1 = require("../../../index"); | ||
@@ -89,3 +90,3 @@ class AdRendererBasePlugin extends index_1.BasePlugin { | ||
return res | ||
.header(this.displayContextHeader, JSON.stringify(adRendererResponse.displayContext)) | ||
.header(this.displayContextHeader, jsesc(adRendererResponse.displayContext, { json: true })) | ||
.status(200) | ||
@@ -92,0 +93,0 @@ .send(adRendererResponse.html); |
# Changelog | ||
# 0.3.8 - 2018-03-19 | ||
- Fix invalid characters issues in the DisplayContext header | ||
# 0.3.7 - 2018-03-13 | ||
@@ -4,0 +8,0 @@ |
@@ -24,3 +24,4 @@ import { core } from "@mediarithmics/plugins-nodejs-sdk"; | ||
</body> | ||
</html>` | ||
</html>`, | ||
displayContext: { hello: "❤" } | ||
}; | ||
@@ -27,0 +28,0 @@ |
@@ -217,2 +217,3 @@ import { expect } from "chai"; | ||
expect(res.status).to.eq(200); | ||
expect(res.header["x-mics-display-context"]).to.eq("{\"hello\":\"\\u2764\"}") | ||
@@ -219,0 +220,0 @@ done(); |
{ | ||
"name": "@mediarithmics/plugins-nodejs-sdk", | ||
"version": "0.3.7", | ||
"version": "0.3.8", | ||
"description": "This is the mediarithmics nodejs to help plugin developers bootstrapping their plugin without having to deal with most of the plugin boilerplate", | ||
@@ -26,2 +26,3 @@ "repository": "github:MEDIARITHMICS/plugins-nodejs-sdk", | ||
"handlebars": "^4.0.11", | ||
"jsesc": "^2.5.1", | ||
"lodash": "^4.17.4", | ||
@@ -37,2 +38,3 @@ "memory-cache": "^0.2.0", | ||
"@types/chai": "^4.0.10", | ||
"@types/jsesc": "^0.4.29", | ||
"@types/mocha": "^2.2.46", | ||
@@ -39,0 +41,0 @@ "@types/mockery": "^1.4.29", |
import * as express from "express"; | ||
import * as _ from "lodash"; | ||
import * as jsesc from "jsesc"; | ||
@@ -150,3 +151,3 @@ import { | ||
this.displayContextHeader, | ||
JSON.stringify(adRendererResponse.displayContext) | ||
jsesc(adRendererResponse.displayContext, {json: true}) | ||
) | ||
@@ -153,0 +154,0 @@ .status(200) |
320985
8137
18
15
+ Addedjsesc@^2.5.1
+ Addedjsesc@2.5.2(transitive)