Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fix routes with placeholders

Works fine aside from GC bugs which segfault Rakudo
  • Loading branch information...
commit 0aef89f9e80db8257de18ca87b7f70d4a4f182e5 1 parent 5a2b52a
Tadeusz Sośnierz authored

Showing 1 changed file with 2 additions and 1 deletion. Show diff stats Hide diff stats

  1. +2 1  lib/Bailador.pm
3  lib/Bailador.pm
@@ -23,7 +23,7 @@ sub route_to_regex($route) {
23 23 multi parse_route(Str $route) {
24 24 my $r = route_to_regex($route);
25 25 say $r.perl;
26   - return / ^ <$r> $ /
  26 + return / ^ <_capture=$r> $ /
27 27 }
28 28
29 29 multi parse_route($route) {
@@ -66,6 +66,7 @@ sub dispatch($env) {
66 66 if $env<REQUEST_URI> ~~ $r.key {
67 67 $current-response.code = 200;
68 68 if $/ {
  69 + unless $/[0] { $/ = $/<_capture> }
69 70 $current-response.content = $r.value.(|$/.list);
70 71 } else {
71 72 $current-response.content = $r.value.();

0 comments on commit 0aef89f

Please sign in to comment.
Something went wrong with that request. Please try again.