Skip to content
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

Stabilize routing #22

Merged
merged 2 commits into from Nov 13, 2023
Merged

Stabilize routing #22

merged 2 commits into from Nov 13, 2023

Conversation

kfly8
Copy link
Collaborator

@kfly8 kfly8 commented Nov 12, 2023

This pull request stabilizes routing such as:

get '/api/me' => sub {
    my ($self, $c) = @_;
    $c->halt_text(200, '/api/me');
};

get '/api/:name' => sub {
    my ($self, $c) = @_;
    $c->halt_text(200, '/api/:name');
};

# Matching routing was unstable due to hash randomization.
GET "/api/me" # => /api/me or /api/:name

@@ -74,9 +74,6 @@ sub psgi {
sub build_app {
my $self = shift;

#router
my $router = Router::Boom->new;
$router->add($_ => $self->_router->{$_} ) for keys %{$self->_router};
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The order of keys %{$self->_router} is random

@kfly8 kfly8 self-assigned this Nov 13, 2023
@kfly8 kfly8 requested a review from kazeburo November 13, 2023 01:05
@kazeburo kazeburo merged commit e34290a into master Nov 13, 2023
13 checks passed
@kfly8 kfly8 deleted the improve-routing branch November 13, 2023 02:22
kazeburo added a commit that referenced this pull request Nov 13, 2023
Changelog diff is:

diff --git a/Changes b/Changes
index e638eaf..4605acb 100644
--- a/Changes
+++ b/Changes
@@ -2,6 +2,10 @@ Revision history for Perl extension Kossy
 
 {{$NEXT}}
 
+0.63 2023-11-13T02:24:23Z
+
+        - Stabilize routing #22
+
 0.62 2023-11-09T08:56:51Z
 
         - Fixed JSON request #21
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.

None yet

2 participants