bowler-framework / Bowler

RESTful Web Framework based on Scala, built on top of Scalatra & Scalate
http://bowlerframework.org
BSD 3-Clause "New" or "Revised" License
119 stars 13 forks source link

POST is incorrectly allowed on GET-only resource #7

Closed mjg123 closed 13 years ago

mjg123 commented 13 years ago

With this minimal Controller:

class MyController extends Controller with Renderable {
 get("/widget")((request, response) => {
    render( some_json_thing )
  })
}

Attempts to POST to that resource result in a 404. Also, OPTIONS on that resource returns:

Content-Length: 0
Server: Jetty(6.1.22)
Allow: GET, HEAD, POST, TRACE, OPTIONS
Content-Type: text/plain; charset=utf-8

I think that POST should result in 405 and should not be in the Allow header.

wfaler commented 13 years ago

Good catch, just out of curiousity, are you using the Filter or Servlet when you get this? Wondering if it may differ between the filter and servlet implementations..

I suspect this may be an upstream defect on Scalatra (which Bowler builds on top of), so once I have more detail, I might close this issue and refer to a Scalatra issue..

mjg123 commented 13 years ago

Using the filter. You can reproduce this problem almost exactly using the bowler-quickstart project and asking doing OPTIONS http://localhost:8080

wfaler commented 13 years ago

Closing it here, issue moved here instead: https://github.com/scalatra/scalatra/issues/53

Will follow through with the Scalatra guys.