Comments (2)
As you already diagnosed, it's in this line.
method path-absolute($/) {
my $result = '/';
$result ~= $_<pchars>.ast with $<segment-nz>;
$result ~= '/' ~ $_<pchars>.ast for @$<segment>; # <-- here
make $result;
}
That's an action method for a grammar.
A quick debug output gives:
Match.new(:orig("/r/perl6/comments/42dkme/perl6_not_being_an_interpreted_language/?rdt=61905"), :from(3), :pos(8), :hash(Map.new((:pchars(Match.new(:orig("/r/perl6/comments/42dkme/perl6_not_being_an_interpreted_language/?rdt=61905"), :from(3), :pos(8), :list(([Match.new(:orig("/r/perl6/comments/42dkme/perl6_not_being_an_interpreted_language/?rdt=61905"), :from(3), :pos(8))],)), :made("perl6")))))), :made("perl6"))
Match.new(:orig("/r/perl6/comments/42dkme/perl6_not_being_an_interpreted_language/?rdt=61905"), :from(9), :pos(17), :hash(Map.new((:pchars(Match.new(:orig("/r/perl6/comments/42dkme/perl6_not_being_an_interpreted_language/?rdt=61905"), :from(9), :pos(17), :list(([Match.new(:orig("/r/perl6/comments/42dkme/perl6_not_being_an_interpreted_language/?rdt=61905"), :from(9), :pos(17))],)), :made("comments")))))), :made("comments"))
Match.new(:orig("/r/perl6/comments/42dkme/perl6_not_being_an_interpreted_language/?rdt=61905"), :from(18), :pos(24), :hash(Map.new((:pchars(Match.new(:orig("/r/perl6/comments/42dkme/perl6_not_being_an_interpreted_language/?rdt=61905"), :from(18), :pos(24), :list(([Match.new(:orig("/r/perl6/comments/42dkme/perl6_not_being_an_interpreted_language/?rdt=61905"), :from(18), :pos(24))],)), :made("42dkme")))))), :made("42dkme"))
Match.new(:orig("/r/perl6/comments/42dkme/perl6_not_being_an_interpreted_language/?rdt=61905"), :from(25), :pos(64), :hash(Map.new((:pchars(Match.new(:orig("/r/perl6/comments/42dkme/perl6_not_being_an_interpreted_language/?rdt=61905"), :from(25), :pos(64), :list(([Match.new(:orig("/r/perl6/comments/42dkme/perl6_not_being_an_interpreted_language/?rdt=61905"), :from(25), :pos(64))],)), :made("perl6_not_being_an_interpreted_language")))))), :made("perl6_not_being_an_interpreted_language"))
Match.new(:orig("/r/perl6/comments/42dkme/perl6_not_being_an_interpreted_language/?rdt=61905"), :from(65), :pos(65))
Notice that the last match is empty. That's the emptyness after the last "/" and before the "?" in the URI.
In similar action methods a few lines down I see guards for this. Replicating them gives:
$result ~= '/' ~ ($_<pchars> ?? $_<pchars>.ast !! ~$_) for @$<segment>;
This fixes the issue.
But I have no idea what's happening. Can I summon a regex expert? Maybe @lizmat?
- What is
.ast
meant to return? - Why is the fallback
~$_
instead of just''
?
from cro-http.
I think I understand a bit. ~$_
is the unprocessed input. @$ is a list of matched input. If the element in that list happens to be a pchars
, then take the processed output (pchars percent-encodes it's content), if not, just take the input unprocessed.
from cro-http.
Related Issues (20)
- Repeatable HTTP 2 issue HOT 2
- Installation Failure - "Tried to get the result of a broken Promise..." HOT 1
- Please show URL on a 404 in HTTP::Client
- Warning during installation - "rakudo is loading libcrypto in an unsafe way" HOT 4
- Multiple Cro::HTTP::Client objects fetching the same URL, hangs often HOT 2
- Native call expected argument 2 to reference a native integer, but got NativeRef HOT 2
- Cro::HTTP::Cookie fails to parse cookies from podverse.net HOT 1
- Flaky test failures for 0.8.7 on Rakudo 2022.04 HOT 1
- Cro::HTTP::Client stopped working (after upgrade to the latest version of Raku) HOT 8
- Cookie order in header does not follow RFC6265
- Client unable to fetch URLs with comma
- ignore cookie that don't respect RFC
- Minor test issue installing on new MacOS Ventura 13.3 -- "Tests out of sequence." found/expected 47/48; 48/47
- No error when port is already taken?
- Cro logging mangles shell display
- Cro::HTTP::Client is not behaving correctly when using https proxy HOT 1
- Mishandling of headers timeout when sending out a big body
- A method to reset connection
- Unable to read the default `.pem` files generated by a Cro app. HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cro-http.