Skip to content

Commit c048a1c

Browse files
committed
fix(snippet): revert changes to snippet injection position - fixes #1062
re: johnpapa/generator-hottowel#171
1 parent 5405888 commit c048a1c

5 files changed

Lines changed: 5 additions & 5 deletions

File tree

lib/default-config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ module.exports = {
195195
whitelist: [],
196196
blacklist: [],
197197
rule: {
198-
match: /$/,
198+
match: /<body[^>]*>/i,
199199
fn: function (snippet, match) {
200200
return match + snippet;
201201
}

test/specs/e2e/proxy/e2e.proxy.proxy.options.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ describe("E2E proxy test with `proxyOptions`", function () {
4141

4242
it("sets options for node-http-proxy", function (done) {
4343

44-
var expected = app.html + bs.options.get("snippet");
44+
var expected = app.html.replace("BS", bs.options.get("snippet") + "BS");
4545
var headers;
4646

4747
app.app.stack.unshift({

test/specs/e2e/proxy/e2e.proxy.req.headers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ describe("E2E proxy test with custom req headers", function () {
4646

4747
it("sets custom headers on proxy reqs", function (done) {
4848

49-
var expected = app.html + bs.options.get("snippet");
49+
var expected = app.html.replace("BS", bs.options.get("snippet") + "BS");
5050
var headers;
5151

5252
app.app.stack.unshift({

test/specs/e2e/proxy/e2e.proxy.req.headers.obj.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ describe("E2E proxy test with custom req headers as object", function () {
4444

4545
it("sets custom headers on proxy reqs from an object", function (done) {
4646

47-
var expected = app.html + bs.options.get("snippet");
47+
var expected = app.html.replace("BS", bs.options.get("snippet") + "BS");
4848
var headers;
4949

5050
app.app.stack.unshift({

test/specs/e2e/proxy/e2e.proxy.secure.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ describe("E2E TLS proxy test", function () {
4545

4646
assert.isString(bs.options.get("snippet"));
4747

48-
var expected = app.html + bs.options.get("snippet");
48+
var expected = app.html.replace("BS", bs.options.get("snippet") + "BS");
4949

5050
request(bs.options.getIn(["urls", "local"]))
5151
.get("/index.html")

0 commit comments

Comments
 (0)