Commit b7fde00
fix: Trim DSN string before URI parsing (#5113)
* fix: Trim DSN string before URI parsing
Trailing or leading whitespace in the DSN string (commonly introduced
by copy-paste) causes a URISyntaxException that crashes the application
on startup. Trim the DSN before passing it to the URI constructor.
Fixes GH-5087
Co-Authored-By: Claude <noreply@anthropic.com>
* docs: Add changelog entry for DSN trimming fix
Co-Authored-By: Claude <noreply@anthropic.com>
* also trim on SentryOptions.setDsn
* fix: Throw clear error when DSN is empty
Previously an empty or whitespace-only DSN string would fall through
to the URI constructor, producing a confusing error message. Now the
Dsn constructor checks for empty strings after trimming and throws
an IllegalArgumentException with a clear message.
Co-Authored-By: Claude <noreply@anthropic.com>
* Format code
* ci: retrigger checks
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Sentry Github Bot <bot+github-bot@sentry.io>1 parent fc52bb8 commit b7fde00
File tree
5 files changed
+43
-3
lines changed- sentry/src
- main/java/io/sentry
- test/java/io/sentry
5 files changed
+43
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
54 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
55 | 58 | | |
56 | 59 | | |
57 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
749 | 749 | | |
750 | 750 | | |
751 | 751 | | |
752 | | - | |
| 752 | + | |
753 | 753 | | |
754 | 754 | | |
755 | 755 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
92 | 110 | | |
93 | 111 | | |
94 | 112 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
588 | 588 | | |
589 | 589 | | |
590 | 590 | | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
591 | 609 | | |
592 | 610 | | |
593 | 611 | | |
| |||
0 commit comments