%2F in hash fragment causing 404 when loading iFrame

<oXygen/> general issues.
metadaddy
Posts: 2
Joined: Tue Dec 06, 2016 11:21 pm

%2F in hash fragment causing 404 when loading iFrame

Post by metadaddy » Tue Dec 06, 2016 11:40 pm

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?
Pat Patterson | Community Champion | http://about.me/patpatterson

bogdan_cercelaru
Posts: 213
Joined: Tue Jul 01, 2014 11:48 am

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

Post by bogdan_cercelaru » Thu Dec 08, 2016 3:48 pm

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
Bogdan Cercelaru
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

metadaddy
Posts: 2
Joined: Tue Dec 06, 2016 11:21 pm

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

Post by metadaddy » Fri Dec 09, 2016 5:31 am

Thanks for the confirmation, Bogdan. Will this be fixed in a future release?

Cheers,

Pat
Last edited by metadaddy on Sat Dec 10, 2016 1:04 am, edited 1 time in total.
Pat Patterson | Community Champion | http://about.me/patpatterson

bogdan_cercelaru
Posts: 213
Joined: Tue Jul 01, 2014 11:48 am

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

Post by bogdan_cercelaru » Fri Dec 09, 2016 5:12 pm

Hello,

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

Regards,
Bogdan
Bogdan Cercelaru
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

sorin_carbunaru
Site Admin
Posts: 248
Joined: Mon May 09, 2016 9:37 am

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

Post by sorin_carbunaru » Mon Apr 10, 2017 1:32 pm

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

Post Reply