You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This request will fail as the URL is mangled to https:/domain-b.com/js/kuromoji/dict, which will cause the XMLHttpRequest to attempt to load it from https://domain-a.com/domain-b.com/js/kuromoji/dict instead.
This is caused by the posix version of path.normalize():
The URL is split into its components using path.split('/'), which results in one empty element between the "https" and "domain-b.com" elements, which is then filtered out by return !!p, resulting in the missing slash.
Workaround
As a temporary workaround, one could replace the snippet with the following, which still filters normal paths but retains paths with a protocol:
JavaScript Code on domain-a.com using kuroshiro.js and kuroshiro-analyzer-kuromoji.js built using
npm run build
:This request will fail as the URL is mangled to
https:/domain-b.com/js/kuromoji/dict
, which will cause the XMLHttpRequest to attempt to load it fromhttps://domain-a.com/domain-b.com/js/kuromoji/dict
instead.This is caused by the posix version of
path.normalize()
:The URL is split into its components using
path.split('/')
, which results in one empty element between the "https" and "domain-b.com" elements, which is then filtered out byreturn !!p
, resulting in the missing slash.Workaround
As a temporary workaround, one could replace the snippet with the following, which still filters normal paths but retains paths with a protocol:
The text was updated successfully, but these errors were encountered: