Repository navigation
Conversation
oalders
marked this pull request as ready for review
October 16, 2026 03:01
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #202 +/- ##
==========================================
+ Coverage 87.13% 87.14% +0.01%
==========================================
Files 64 64
Lines 2099 2101 +2
Branches 512 512
==========================================
+ Hits 1829 1831 +2
Misses 110 110
Partials 160 160 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
URI::geo::_init parsed the path to normalise longitude at the poles, so any unparseable geo: string made the constructor croak. Skip the normalisation when the path doesn't parse, without touching the caller's $@, and leave validation to the accessors, matching every other scheme. The POD notes that up to and including 5.37 URI->new died on such input. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Why would you not want malformed URIs to die in new()? |
Member
Author
|
@esabol no other package in this URI distribution behaves this way, so it's an outlier. This change should bring it in line with the other schemes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #201
Changes
URI::geo::_initprobes the latitude underdo { local $@; eval { ... } }and only does the pole step when the path parses. A malformedgeo:string now builds aURI::geoobject, like every other scheme, and the caller's$@is left alone.latitude,longitude,location,field, ...) still croakBadly formed geo uri, so that check now happens when a value is read, not in the constructor.Badly formed geo uriitem and said where it is raised.URI->newdied on such input, and that 5.38 changes this.{{$NEXT}}.Behaviour change:
t/geo_basic.tused to assert thatURI->new("geo:1")dies. That came with the original port of Andy Armstrong's standalone URI::geo (9d9b36c, #141). Inside URI it is the outlier:URI::urn::_initfalls back on a bad NID rather than croaking. That test is replaced with the new behaviour. Code that usedeval { URI->new(...) }to validategeo:strings should call an accessor instead.Testing
t/geo_basic.t:URI->new("geo:1")returns aURI::geo, leaves a sentinel$@alone, and->latitudecroaks. It fails on the oldgeo.pm(dies at line 52) and passes with the fix.prove -lr t: 63 files, 1038 tests, PASS.precious lintis clean./code-review-intense-flow(general, security, test-value): clean after one fix round (local $@) and again after the POD version note. Local Codex review: clean.Declined findings
geo:90,x,geo:a,b, and thelocationaccessor: these take the same_parsefailure path asgeo:1.geo:91,0croakingLatitude out of range: the premise is false._parsedoes no range check, solatitudereturns 91 (checked).is_validhelper and a fuzz test: nothing in the issue or in any caller needs them (YAGNI).URI->newdoes not raise it.🤖 Generated with Claude Code · Opus 5.5