Skip to content

Improve bad input handling in resolveLSID #6738

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 8, 2025
Merged

Conversation

labkey-jeckels
Copy link
Contributor

@labkey-jeckels labkey-jeckels commented Jun 5, 2025

Rationale

java.lang.IllegalArgumentException: URLDecoder: Illegal hex characters in escape (%) pattern - Error at index 0 in: "" "
	at java.base/java.net.URLDecoder.decode(URLDecoder.java:237) ~[?:?]
	at org.labkey.api.exp.Lsid.decodePart(Lsid.java:290) ~[api-25.7-SNAPSHOT.jar:?]
	at org.labkey.api.exp.Lsid$LsidBuilder.<init>(Lsid.java:372) ~[api-25.7-SNAPSHOT.jar:?]
	at org.labkey.api.exp.Lsid.canonical(Lsid.java:300) ~[api-25.7-SNAPSHOT.jar:?]
	at org.labkey.experiment.controllers.exp.ExperimentController$ResolveLSIDAction.getView(ExperimentController.java:5349) ~[experiment-25.7-SNAPSHOT.jar:?]
	at org.labkey.experiment.controllers.exp.ExperimentController$ResolveLSIDAction.getView(ExperimentController.java:5340) ~[experiment-25.7-SNAPSHOT.jar:?]
	at 

Repro: https://localhost/home/experiment-resolveLSID.view?lsid=urn%3Alsid%3Alabkey.com%3Atest%3Atest%25%22bad%3A2

Changes

  • Catch the exception and show useful error
  • Use DOM builder for trivial UI
  • Minor auto-refactor code cleanup

@labkey-jeckels labkey-jeckels requested a review from a team June 5, 2025 18:14
@labkey-jeckels labkey-jeckels self-assigned this Jun 5, 2025
@labkey-jeckels labkey-jeckels merged commit aec18e5 into develop Jun 8, 2025
13 of 18 checks passed
@labkey-jeckels labkey-jeckels deleted the fb_lsidDecoding branch June 8, 2025 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants