statsrb 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/ext/statsrb/statsrb.c +6 -4
- metadata +1 -1
data/ext/statsrb/statsrb.c
CHANGED
@@ -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 = "
|
293
|
-
const char *
|
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";
|