From 65356ff7e712c5af81de0036c529e089a45762b3 Mon Sep 17 00:00:00 2001 From: Berkeley Martinez Date: Sat, 23 Dec 2017 01:53:11 -0800 Subject: [PATCH] fix(Challenges/frame.js): Make iframe href base relative to / (#16221) This prevents requests from appending to the current challenge url --- common/app/routes/Challenges/utils/frame.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/common/app/routes/Challenges/utils/frame.js b/common/app/routes/Challenges/utils/frame.js index 9a438baa8f..82b2375e4d 100644 --- a/common/app/routes/Challenges/utils/frame.js +++ b/common/app/routes/Challenges/utils/frame.js @@ -11,7 +11,15 @@ const mainId = 'fcc-main-frame'; // the test frame is responsible for running the assert tests const testId = 'fcc-test-frame'; +// base tag here will force relative links +// within iframe to point to '/' instead of +// append to the current challenge url +// if an error occurs during initialization +// the __err prop will be set +// This is then picked up in client/frame-runner.js during +// runTestsInTestFrame below const createHeader = (id = mainId) => ` +