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

post method return 404 #67

Closed
kostya opened this issue Jan 25, 2016 · 6 comments
Closed

post method return 404 #67

kostya opened this issue Jan 25, 2016 · 6 comments
Labels

Comments

@kostya
Copy link

kostya commented Jan 25, 2016

require "kemal"
get "/a" do
  "a"
end

post "/b" do
  "b"
end
curl http://localhost:3000/a
curl http://localhost:3000/b -X POST -d '{"bla":12}'
2016-01-25 22:45:33 +0300 | 200 | GET /a - 91µs
2016-01-25 22:47:08 +0300 | 404 | POST /b - 65µs
@sdogruyol
Copy link
Member

Ouch! This is definitely a bug. Seems like we need to improve the router @f

@sdogruyol sdogruyol added the bug label Jan 25, 2016
@sdogruyol
Copy link
Member

This is not related to POST but more like the router gets the first match on the routes that are exact size.

@f
Copy link
Contributor

f commented Jan 25, 2016

Hmm, actually Radix creates a path "method path" pattern. And the tree path is like "POST /b" for radix. @sdogruyol Can you try radix_path to generate "post/b"? I am not on computer, cannot try right now.

@sdogruyol
Copy link
Member

@f it's POST /b

f pushed a commit to f/kemal that referenced this issue Jan 25, 2016
@f
Copy link
Contributor

f commented Jan 25, 2016

@kostya PR https://github.com/sdogruyol/kemal/pull/68/files fixes this issue. Can you verify @sdogruyol?

sdogruyol pushed a commit that referenced this issue Jan 25, 2016
Fix for #67, Radix tree needs path style string
@sdogruyol
Copy link
Member

Fixed as of 23b09ff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants