statsrb 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/ext/statsrb/statsrb.c +6 -4
  2. metadata +1 -1
@@ -289,12 +289,14 @@ static VALUE statsrb_rack_call(VALUE self, VALUE env) {
289
289
 
290
290
  //const char *method = RSTRING_PTR(rb_hash_aref(env, rb_str_new2("REQUEST_METHOD")));
291
291
  // @TODO consider moving the request method to the proper REQUEST_METHOD
292
- const char *method_get = "GET";
293
- const char *method_put = "PUT";
292
+ const char *method_get = "get";
293
+ const char *method_getu = "GET";
294
+ const char *method_put = "put";
295
+ const char *method_putu = "PUT";
294
296
  // Remove the leading /
295
297
  path++;
296
298
  const char *method = strtok(path, "/\0");
297
- if (method && strcmp(method, method_put) == 0) {
299
+ if (method && (strcmp(method, method_put) == 0 || strcmp(method, method_putu) == 0)) {
298
300
  long int statsrb_ts, statsrb_v;
299
301
 
300
302
  // Get the timestamp, default to now.
@@ -337,7 +339,7 @@ static VALUE statsrb_rack_call(VALUE self, VALUE env) {
337
339
  rb_ary_push(body, statsrb_ns);
338
340
  }
339
341
  }
340
- else if (method && strcmp(method, method_get) == 0) {
342
+ else if (method && (strcmp(method, method_get) == 0 || strcmp(method, method_getu) == 0)) {
341
343
  const char * statsrb_str_ns = strtok(NULL, "/\0");
342
344
  if (statsrb_str_ns == NULL) {
343
345
  statsrb_str_ns = "data";
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: statsrb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: