Crypto-Punkers / resolver-engine

Single API for resolving Solidity artefacts and imports
GNU Lesser General Public License v3.0
32 stars 26 forks source link

UrlParser cannot distinguish between URLs and Windows paths #182

Closed yaram closed 5 years ago

yaram commented 5 years ago

UrlParser uses the URL constructor to determine whether the string passed is a browser URL or not.

Unfortunately, absolute windows paths (e.g. C:\an\absolute\path) are successfully parsed as URLs by URL. (e.g. C:\an\absolute\path having protocol: 'c:' and pathname: '\\an\\absolute\\path')

This results in the windows path being sent to request leading to an error of the form Error: Invalid URI "c:/an/absolute/path".

yaram commented 5 years ago

Looking for input on what the best solution for this would be.

I've though of a few options: