Skip to content

Commit

Permalink
Fixed file double protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcorvi committed Apr 6, 2017
1 parent d5a392d commit 1535b80
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/transform/identify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@ export default function (inputArr:Array<string>, options:Options) {
var urlObj:URLObj|null = null;

var protocol = hasProtocol(encoded) || "";

// remove the protocol before proceeding to any other test
if(protocol) encoded = encoded.substr(protocol.length);

// test 1: it's a file
if(options.files && protocol === "file:///" && encoded.substr(protocol.length).split(/\/|\\/).length - 1) {
if(options.files && protocol === "file:///" && encoded.split(/\/|\\/).length - 1) {
urlObj = {
reason:"file",
protocol:protocol,
Expand Down

0 comments on commit 1535b80

Please sign in to comment.