[Groonga-commit] groonga/gcs [master] Keys of headers are lowercase

Back to archive index

null+****@clear***** null+****@clear*****
2012年 6月 20日 (水) 18:20:05 JST


Yoji SHIDARA	2012-06-20 18:20:05 +0900 (Wed, 20 Jun 2012)

  New Revision: 75fa1a2a1a1a1b25059f62dac33edb8aaeba0331
  https://github.com/groonga/gcs/commit/75fa1a2a1a1a1b25059f62dac33edb8aaeba0331

  Log:
    Keys of headers are lowercase

  Modified files:
    lib/domain.js
    test/domain.test.js

  Modified: lib/domain.js (+2 -2)
===================================================================
--- lib/domain.js    2012-06-20 18:12:47 +0900 (c682a7d)
+++ lib/domain.js    2012-06-20 18:20:05 +0900 (cfa0845)
@@ -48,8 +48,8 @@ Domain.prototype = {
     if (source.query && source.query.DomainName)
       return source.query.DomainName;
 
-    if (source.headers && source.headers['Host']) {
-      var host = source.headers['Host'];
+    if (source.headers && source.headers['host']) {
+      var host = source.headers['host'];
       var domainNameFromHost = Domain.getNameFromHost(host);
       if (domainNameFromHost)
         return domainNameFromHost;

  Modified: test/domain.test.js (+2 -2)
===================================================================
--- test/domain.test.js    2012-06-20 18:12:47 +0900 (43cdc41)
+++ test/domain.test.js    2012-06-20 18:20:05 +0900 (4df2cc7)
@@ -72,7 +72,7 @@ suite('domain', function() {
     suite('from host name', function() {
       test('valid', function() {
         var host = 'doc-test0123-id0123.us-east-1.example.com';
-        var request = { headers: { Host: host } };
+        var request = { headers: { host: host } };
         var domain = new Domain(request);
         assert.equal(domain.name, 'test0123');
       });
@@ -80,7 +80,7 @@ suite('domain', function() {
       test('invalid', function() {
         assert.throw(function() {
           var host = 'doc-domain_name-id0123.us-east-1.example.com';
-          var request = { headers: { Host: host } };
+          var request = { headers: { host: host } };
           var domain = new Domain(request);
         }, /cannot appear in a domain name/)
       });
-------------- next part --------------
HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B...
Download 



Groonga-commit メーリングリストの案内
Back to archive index