Skip to content

Commit b672542

Browse files
authored
Convert any remaining relative HREFs to absolute HREFs (#149)
1 parent e052bf0 commit b672542

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

proxies/live/apiproxy/resources/jsc/SearchAndReplaceResponse.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,15 @@ var searchAndReplaceStrings = [
332332
searchForRegex: /\s+data-block-key=\\"[^"]*\\"/gm,
333333
replaceWithStr: "",
334334
},
335+
{
336+
comment1: "=============================================================",
337+
comment2: "Convert any remaining relative HREFs to absolute HREFs ",
338+
comment3: "=============================================================",
339+
},
340+
{
341+
searchForRegex: /href=\\"\//gm,
342+
replaceWithStr: 'href=\\"https://www.nhs.uk/',
343+
},
335344
];
336345

337346
var responseContent = context.getVariable("response.content");

proxies/sandbox/apiproxy/resources/jsc/SearchAndReplaceResponse.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,15 @@
277277
// searchForRegex: /\s+data-block-key=\\"[^"]*\\"/gm,
278278
// replaceWithStr: "",
279279
// },
280+
// {
281+
// comment1: "=============================================================",
282+
// comment2: "Convert any remaining relative HREFs to absolute HREFs ",
283+
// comment3: "=============================================================",
284+
// },
285+
// {
286+
// searchForRegex: /href=\\"\//gm,
287+
// replaceWithStr: 'href=\\"https://www.nhs.uk/',
288+
// },
280289
// ];
281290

282291
var responseContent = context.getVariable("response.content");

0 commit comments

Comments
 (0)