soveran / cuba

Rum based microframework for web development.
http://cuba.is
MIT License
1.44k stars 249 forks source link

Not all HTTP methods are supported #77

Closed firoxer closed 8 years ago

firoxer commented 8 years ago

I noticed that matching for OPTIONS requests is not supported. I checked the source for Cuba and found out that matching for the existing methods is simple sugar on top of Rack (https://github.com/soveran/cuba/blob/master/lib/cuba.rb#L328-L331). I tried adding OPTIONS and the other missing HTTP methods in the same manner as the other methods have been implemented and it worked well.

I commited the new methods in my fork. There were no tests related to HTTP methods, so I didn't write any. The fork is ready for merge.

I think the added methods are a worthwhile patch. IMO, they are not a new feature but an extension to an existing one. The addition doesn't interfere with Cuba's minimalistic approach.

soveran commented 8 years ago

Hello @firoxer, thanks a lot for taking care of this! I'll be able to work on this on Monday, but I think it's a good idea to add these methods. Do you want to create a pull request? Again, thanks a lot for your help!

firoxer commented 8 years ago

Sure. I created the pull request. Let me know if something is missing!