File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -423,7 +423,7 @@ function triggerEvent(eventType, options) {
423423}
424424
425425var dsnKeys = 'source protocol user pass host port path' . split ( ' ' ) ,
426- dsnPattern = / ^ (?: ( \w + ) : ) ? \/ \/ ( \w + ) ( : \w + ) ? @ ( [ \w \. - ] + ) (?: : ( \d + ) ) ? ( \/ .* ) / ;
426+ dsnPattern = / ^ (?: ( \w + ) : ) ? \/ \/ (?: ( \w + ) ( : \w + ) ? @ ) ? ( [ \w \. - ] + ) (?: : ( \d + ) ) ? ( \/ .* ) / ;
427427
428428function RavenConfigError ( message ) {
429429 this . name = 'RavenConfigError' ;
Original file line number Diff line number Diff line change @@ -359,6 +359,15 @@ describe('globals', function() {
359359 assert . strictEqual ( pieces . host , 'matt-robenolt.com' ) ;
360360 } ) ;
361361
362+ it ( 'should parse domain without user' , function ( ) {
363+ var pieces = parseDSN ( 'http://matt-robenolt.com/1' ) ;
364+ assert . strictEqual ( pieces . protocol , 'http' ) ;
365+ assert . strictEqual ( pieces . user , '' ) ;
366+ assert . strictEqual ( pieces . port , '' ) ;
367+ assert . strictEqual ( pieces . path , '/1' ) ;
368+ assert . strictEqual ( pieces . host , 'matt-robenolt.com' ) ;
369+ } ) ;
370+
362371 it ( 'should raise a RavenConfigError when setting a password' , function ( ) {
363372 try {
364373 parseDSN ( 'http://user:pass@example.com/2' ) ;
You can’t perform that action at this time.
0 commit comments