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) {
423
423
}
424
424
425
425
var dsnKeys = 'source protocol user pass host port path' . split ( ' ' ) ,
426
- dsnPattern = / ^ (?: ( \w + ) : ) ? \/ \/ ( \w + ) ( : \w + ) ? @ ( [ \w \. - ] + ) (?: : ( \d + ) ) ? ( \/ .* ) / ;
426
+ dsnPattern = / ^ (?: ( \w + ) : ) ? \/ \/ (?: ( \w + ) ( : \w + ) ? @ ) ? ( [ \w \. - ] + ) (?: : ( \d + ) ) ? ( \/ .* ) / ;
427
427
428
428
function RavenConfigError ( message ) {
429
429
this . name = 'RavenConfigError' ;
Original file line number Diff line number Diff line change @@ -359,6 +359,15 @@ describe('globals', function() {
359
359
assert . strictEqual ( pieces . host , 'matt-robenolt.com' ) ;
360
360
} ) ;
361
361
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
+
362
371
it ( 'should raise a RavenConfigError when setting a password' , function ( ) {
363
372
try {
364
373
parseDSN ( 'http://user:pass@example.com/2' ) ;
You can’t perform that action at this time.
0 commit comments