File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# vNext
22
33* Increase max cached events to 30 (#1029 )
4+ * Normalize DSN URI (#1030 )
45
56# 3.1.2
67
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ URI getSentryUri() {
4747
4848 Dsn (@ Nullable String dsn ) throws InvalidDsnException {
4949 try {
50- URI uri = new URI (dsn );
50+ URI uri = new URI (dsn ). normalize () ;
5151 String userInfo = uri .getUserInfo ();
5252 if (userInfo == null || userInfo .isEmpty ()) {
5353 throw new IllegalArgumentException ("Invalid DSN: No public key provided." );
Original file line number Diff line number Diff line change @@ -73,4 +73,10 @@ class DsnTest {
7373 val ex = assertFailsWith<InvalidDsnException > { Dsn (" https://:secret@host/path/id" ) }
7474 assertEquals(" java.lang.IllegalArgumentException: Invalid DSN: No public key provided." , ex.message)
7575 }
76+
77+ @Test
78+ fun `dsn is normalized` () {
79+ val dsn = Dsn (" http://key@host//id" )
80+ assertEquals(" http://host/api/id" , dsn.sentryUri.toURL().toString())
81+ }
7682}
You can’t perform that action at this time.
0 commit comments