about summary refs log tree commit homepage
path: root/ext/http11/http11.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/http11/http11.c')
-rw-r--r--ext/http11/http11.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/ext/http11/http11.c b/ext/http11/http11.c
index 3cb6697..1e028ee 100644
--- a/ext/http11/http11.c
+++ b/ext/http11/http11.c
@@ -68,8 +68,6 @@ DEF_MAX_LENGTH(HEADER, (1024 * (80 + 32)));
 
 void http_field(void *data, const char *field, size_t flen, const char *value, size_t vlen)
 {
-  char *ch;
-  const char *fch;
   VALUE req = (VALUE)data;
   VALUE v = Qnil;
   VALUE f = Qnil;
@@ -90,13 +88,7 @@ void http_field(void *data, const char *field, size_t flen, const char *value, s
   memcpy(RSTRING_PTR(f),
          RSTRING_PTR(global_http_prefix),
          RSTRING_LEN(global_http_prefix));
-
-  ch = RSTRING_PTR(f) + RSTRING_LEN(global_http_prefix);
-  for(fch = field; flen-- != 0; ++fch) {
-    *ch++ = (*fch >= 'a' && *fch <= 'z') ?
-            ASCII_UPCASE_CHAR(*fch) :
-            (*fch == '-' ? '_' : *fch);
-  }
+  memcpy(RSTRING_PTR(f) + RSTRING_LEN(global_http_prefix), field, flen);
 
   rb_hash_aset(req, f, v);
 }