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

allow PATCH verb to be processed by the ruby application #184

Closed
wants to merge 1 commit into from

Conversation

mkristian
Copy link
Member

the HTTP PATCH verb works with RackServlet but with RackFilter the filter chain returns 501 on those verbs and 501 is considered as handled and will not be processed by the ruby application. this patch adds 501 to the list of responses for which the request will be passed on to the ruby application.

the patch is particular important for rich client using rest(ful) API servers. the PATCH allows to partially updated resources on the server whereas PUT is meant to sent the full object over the wire.

Sponsored by: Lookout, Inc.

@kares
Copy link
Member

kares commented Nov 6, 2014

great, for full completeness (this has been a headache for a long time esp. as the non-handled statuses default is growing) what server did you test out (I can assume @lookout uses Tomcat and/or Jetty) ?

@mkristian
Copy link
Member Author

I tested it on jetty and still working on a little test sinatra app - try to put a tomcat and maybe jboss runner in there as well.

actually RackServlet did work without this patch. the 501 via Servlets come from the HTTPServlet itself (java.servlet part). but with Filter (filter-chain) I did not find the place and even looked briefly into the jetty code itself but could not find anything. but tomcat docu talks about 501 for non-standard HTTP verbs.

@mkristian
Copy link
Member Author

now I tested it against jetty, tomcat and wildfly: http://github.com/mkristian/hellowarld for details about the versions see the Mavenfile

@rtyler
Copy link

rtyler commented Nov 7, 2014

@kares it would be useful to know whether this pull request is good to go and when a release of jruby-rack might happen. If it's going to be a "while" then we'll have to go ahead and roll out an internal fork of the gem internally @lookout

@kares
Copy link
Member

kares commented Nov 7, 2014

good to go but it won't go into master ... no asap release since you can easily work-around this by setting a filter-parameter

value = config.getInitParameter("responseNotHandledStatuses");
also I will keep it open for a while as I'd like to re-think this once I'm working on the code base ... as the unhandled statuses seem to be "growing" ;(

@kares
Copy link
Member

kares commented Nov 15, 2014

put this on 1.1-stable as 1cb258a ... @mkristian needed some merging maybe we shall target there now.

@kares kares closed this Nov 15, 2014
@mkristian mkristian deleted the patch-verb branch January 5, 2015 17:09
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.

3 participants