%2F in hash fragment causing 404 when loading iFrame

<oXygen/> general issues.
metadaddy
Posts: 2

%2F in hash fragment causing 404 when loading iFrame

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: 200

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

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

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

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: 200

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

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: 139

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

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

Return to “Other Issues”

Who is online

Users browsing this forum: No registered users and 3 guests