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
{{ message }}
Repository navigation
Add check that URLs don't contain Windows path separators (\) #91
This library takes URLs as input. A path is not a valid input if it's separated with \. In my opinion it's the job of the application to pass a valid URL.
Instead we should validate if the passed string is a valid URL.
changed the title [-]Add validation to check that URLs don't contain Windows path separators (`\`)[/-][+]Add check that URLs don't contain Windows path separators (`\`)[/+]on Apr 18, 2021
Activity
fitzgen commentedon Feb 11, 2014
We can't rely on the path module because it only exists in node, not the web or inside firefox.
The reason we use
/is because a source map's sources are URLs and URLs use/.I'm not against supporting alternative path separators as long as it doesn't negatively affect the existing 99% use case.
ai commentedon Feb 11, 2014
I mean, that if library user will set
fileto..\build\main.css,source-mapshoudl replace it to../build/main.cssin output map.ai commentedon Feb 11, 2014
We can try to load
pathand if it will be loaded and will say, thatpath.sep == "\\"we will know, that we are in Windows’s node.js.sokra commentedon Feb 12, 2014
This library takes URLs as input. A path is not a valid input if it's separated with
\. In my opinion it's the job of the application to pass a valid URL.Instead we should validate if the passed string is a valid URL.
ai commentedon Feb 12, 2014
@sokra OK, no problem, I make filter in my app.
But we really need validation, because with issue is in many apps. For example, Rework also send file name, not URL: https://github.com/reworkcss/css-stringify/blob/master/lib/source-map-support.js#L22
Fix path issues with source maps
Fix path issues with source maps
[-]No Windows support[/-][+]Add validation to check that URLs don't contain Windows path separators (`\`)[/+][-]Add validation to check that URLs don't contain Windows path separators (`\`)[/-][+]Add check that URLs don't contain Windows path separators (`\`)[/+]hybrist commentedon Apr 18, 2021
Updated title to reflect the expected behavior.