File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed
Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ function map(array, callback) {
8282 * function.
8383 */
8484function mapDomain ( domain , callback ) {
85- const parts = domain . split ( '@' ) ;
85+ const parts = domain . split ( '@' , 2 ) ;
8686 let result = '' ;
8787 if ( parts . length > 1 ) {
8888 // In email addresses, only the domain name should be punycoded. Leave
Original file line number Diff line number Diff line change @@ -886,10 +886,10 @@ Url.prototype.resolveObject = function resolveObject(relative) {
886886 // This especially happens in cases like
887887 // url.resolveObject('mailto:local1@domain1', 'local2@domain2')
888888 const authInHost =
889- result . host && result . host . indexOf ( '@' ) > 0 && result . host . split ( '@' ) ;
889+ result . host && result . host . indexOf ( '@' ) > 0 && result . host . split ( '@' , 2 ) ;
890890 if ( authInHost ) {
891- result . auth = authInHost . shift ( ) ;
892- result . host = result . hostname = authInHost . shift ( ) ;
891+ result . auth = authInHost [ 0 ] ;
892+ result . host = result . hostname = authInHost [ 1 ] ;
893893 }
894894 }
895895 result . search = relative . search ;
@@ -966,11 +966,10 @@ Url.prototype.resolveObject = function resolveObject(relative) {
966966 // Occasionally the auth can get stuck only in host.
967967 // This especially happens in cases like
968968 // url.resolveObject('mailto:local1@domain1', 'local2@domain2')
969- const authInHost = result . host && result . host . indexOf ( '@' ) > 0 ?
970- result . host . split ( '@' ) : false ;
969+ const authInHost = result . host && result . host . indexOf ( '@' ) > 0 && result . host . split ( '@' , 2 ) ;
971970 if ( authInHost ) {
972- result . auth = authInHost . shift ( ) ;
973- result . host = result . hostname = authInHost . shift ( ) ;
971+ result . auth = authInHost [ 0 ] ;
972+ result . host = result . hostname = authInHost [ 1 ] ;
974973 }
975974 }
976975
You can’t perform that action at this time.
0 commit comments