-
-
Notifications
You must be signed in to change notification settings - Fork 5k
modify method when pass absolute path for option.base #1353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -561,7 +561,9 @@ function parsePath (path) { | |
} | ||
|
||
function cleanPath (path) { | ||
return path.replace(/\/\//g, '/') | ||
var ishttp = /^\w+:\/\//.exec(path); | ||
var http = Array.isArray(ishttp) ? ishttp[0] : ''; | ||
return http + path.substr(http.length).replace(/\/{2,}/g, '/'); | ||
} | ||
|
||
/* */ | ||
|
@@ -1759,7 +1761,9 @@ function normalizeBase (base) { | |
} | ||
} | ||
// make sure there's the starting slash | ||
if (base.charAt(0) !== '/') { | ||
if(/^[a-z]+:\/\//i.test(base)){ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The RepExpr here needs to be modified. because there's still this kind of situation: //google.com /^([a-z]+:)?///i |
||
|
||
}else if (base.charAt(0) !== '/') { | ||
base = '/' + base; | ||
} | ||
// remove trailing slash | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 请问,需要修改源码才能实现在History模式下去掉http://api.com/http:/static.com/test前面的部分吗 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 一般 |
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The RepExpr here needs to be modified. because there's still this kind of situation:
so the RegExpr should be it
/^([a-z]+:)?\/\//i