Page 1 of 1

%2F in hash fragment causing 404 when loading iFrame

Posted: Tue Dec 06, 2016 11:40 pm
by metadaddy
Hi - I'm chasing down a problem that our users have been seeing when clicking links in Slack and some email clients. We have URLs such as

Code: Select all

https://streamsets.com/documentation/datacollector/latest/help/#Getting_Started/What_is_DataCollector.html#concept_sjz_rmx_3q
When I paste this into Slack, it looks just the same, but clicking it sends a different URL to the browser:

Code: Select all

https://streamsets.com/documentation/datacollector/latest/help/#Getting_Started%2FWhat_is_DataCollector.html%23concept_sjz_rmx_3q
This results in a 404 in the 'content' iframe. What seems to be happening is that Slack is, correctly, percent-encoding special characters in the hash fragment.

Looking at toc-driver.js, the loadiframe function replaces %23 with #, but does not replace %2F with /. I did a quick local test, and replacing line 152

Code: Select all

dynamicURL = dynamicURL.replace(/%23/g,'#');
with

Code: Select all

dynamicURL = dynamicURL.replace(/%23/g,'#').replace(/%2F/ig,'/');
fixes things. Should we make this change in toc-driver.js on our server?

Re: %2F in hash fragment causing 404 when loading iFrame

Posted: Thu Dec 08, 2016 3:48 pm
by bogdan_cercelaru
Hello,

I've tested this scenario and I can confirm the issue.
As you found, to solve this issue, you have to edit the "${DITA_OT_DIR}\plugins\com.oxygenxml.webhelp\oxygen-webhelp\resources\skins\desktop\toc_driver.js" file and replace:

Code: Select all


dynamicURL = dynamicURL.replace(/%23/g,'#');
with

Code: Select all


dynamicURL = dynamicURL.replace(/%23/g,'#').replace(/%2F/ig,'/');
Regards,
Bogdan

Re: %2F in hash fragment causing 404 when loading iFrame

Posted: Fri Dec 09, 2016 5:31 am
by metadaddy
Thanks for the confirmation, Bogdan. Will this be fixed in a future release?

Cheers,

Pat

Re: %2F in hash fragment causing 404 when loading iFrame

Posted: Fri Dec 09, 2016 5:12 pm
by bogdan_cercelaru
Hello,

Yes, this will be resolved in the next version of Oxygen.

Regards,
Bogdan

Re: %2F in hash fragment causing 404 when loading iFrame

Posted: Mon Apr 10, 2017 1:32 pm
by sorin_carbunaru
Hello,

The new oXygen 19.0 was released last week and the issue you reported has been fixed in this version.

Best wishes,
Sorin Carbunaru
oXygen XML