My router page code has stopped working after months of it working fine.
This breaks my website in a big way.
Investigation determined the url decoding has a bug.
%2B is being decoded as a - instead of a +
Here is my evidence:
From router.js
export function validate_Router(request) {
return ok(“valid-reg-page”, { “cipherData”: request.path[0] });
}
From my router page:
$w.onReady(function () {
…
let cipherData = wixWindow.getRouterData().cipherData;
console.log(‘cipherData:’,cipherData);
…
}
The link to the page:
https://oakdance.org/validate/b%2FP75ccWH%2Fojvn%2B%2BWW%2BTLA%2FmJw7WISi1ZpN%2BkrDsr6MoOcu1e%2Fh%2FZ94hWJH8W4ioxRPep6sw7g62lczTtG0G3YD%2BSGE%2FwcYsskiVjkJI4p%2BVwCDV%2BGK%2FUSZPzQw%3D
The console output:
cipherData: b/P75ccWH/ojvn–WW-TLA/mJw7WISi1ZpN-krDsr6MoOcu1e/h/Z94hWJH8W4ioxRPep6sw7g62lczTtG0G3YD-SGE/wcYsskiVjkJI4p-VwCDV-GK/USZPzQw=
Notice that where ever there is a %2B in the url, it has been decoded as - instead of +
@Jim Tucker I recreated your router code and front end code on one of my sites but the problem isn’t present:
https://stevendc88.wixsite.com/expiring-events/test
router code:
import {ok, notFound, WixRouterSitemapEntry} from "wix-router";
export function test_Router(request) {
const name = request.path[0];
return ok("test-page", { "cipherData": name });
}
Page code:
// For full API documentation, including code examples, visit http://wix.to/94BuAAs
import wixWindow from 'wix-window';
$w.onReady(function () {
debugger;
//TODO: write your page related code here...
let cipherInfo = wixWindow.getRouterData();
$w('#cipher').text = `${cipherInfo.cipherData}`;
});
One thing I did notice on your site is that there is a 301 redirect that changes the url. Do you have another site acting as a front page?
Hope this helps
I am not aware of the 301 redirect.
This code was working fine for months, and I am unaware of any changes that would cause the problem.
How would I find the cause of the 301 redirect?
I am not using another site as a front page.
I have checked the Settings/SEO page and there are no 301 redirects.
I have a question into QA.
I have just moved my domain to Wix. Since Wix is now hosting my domain and serving it, there should not be any redirects happening, yet I still have the same problem. Can you please look into this. There has been no response since you said you submitted a question to QA three weeks ago.