File tree 2 files changed +9
-1
lines changed 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -285,7 +285,9 @@ _.assign(Url.prototype, /** @lends Url.prototype */ {
285
285
getPath ( unresolved ) {
286
286
// for unresolved case, this is super simple as that is how raw data is stored
287
287
if ( unresolved ) {
288
- return PATH_SEPARATOR + this . path . join ( PATH_SEPARATOR ) ;
288
+ return PATH_SEPARATOR + (
289
+ this . path ? this . path . join ( PATH_SEPARATOR ) : E
290
+ ) ;
289
291
}
290
292
291
293
var self = this ,
Original file line number Diff line number Diff line change @@ -1700,6 +1700,12 @@ describe('Url', function () {
1700
1700
expect ( url . toString ( ) ) . to . eql ( 'https://postman-echo.com////////get/' ) ;
1701
1701
} ) ;
1702
1702
1703
+ it ( 'getPath->unresolved should handle empty path properly' , function ( ) {
1704
+ var url = new Url ( '{{host}}' ) ;
1705
+
1706
+ expect ( url . getPath ( true ) ) . to . be . equal ( '/' ) ;
1707
+ } ) ;
1708
+
1703
1709
it ( 'should parse string path properly for JSON representation' , function ( ) {
1704
1710
var url = new Url ( {
1705
1711
protocol : 'http' ,
You can’t perform that action at this time.
0 commit comments