{"action":"created","issue":{"url":"https://api.github.com/repos/carstengehling/route_downcaser/issues/10","labels_url":"https://api.github.com/repos/carstengehling/route_downcaser/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/carstengehling/route_downcaser/issues/10/comments","events_url":"https://api.github.com/repos/carstengehling/route_downcaser/issues/10/events","html_url":"https://github.com/carstengehling/route_downcaser/issues/10","id":57642650,"number":10,"title":"In downcase_route_middleware.rb:33 in \"uri_items\": NoMethodError: undefined method `split' for nil:NilClass ","user":{"login":"acrookston","id":52943,"avatar_url":"https://avatars.githubusercontent.com/u/52943?v=3","gravatar_id":"","url":"https://api.github.com/users/acrookston","html_url":"https://github.com/acrookston","followers_url":"https://api.github.com/users/acrookston/followers","following_url":"https://api.github.com/users/acrookston/following{/other_user}","gists_url":"https://api.github.com/users/acrookston/gists{/gist_id}","starred_url":"https://api.github.com/users/acrookston/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acrookston/subscriptions","organizations_url":"https://api.github.com/users/acrookston/orgs","repos_url":"https://api.github.com/users/acrookston/repos","events_url":"https://api.github.com/users/acrookston/events{/privacy}","received_events_url":"https://api.github.com/users/acrookston/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-02-13T19:29:38Z","updated_at":"2015-02-15T19:34:28Z","closed_at":null,"body":"I got this error in my production environment last night. It's only occurred once so far but I figured it might be good to log anyway.\r\n\r\nAs you can see, the `env['REQUEST_URI']` exists but the line that caused the error doesn't think so.\r\nIs it possible the `@env` was not set to `env` in `def call(env)`?\r\n\r\n\r\nEnvironment (anonymized):\r\n\r\n```\r\nCONTENT_TYPE\r\ntext/plain\r\nGATEWAY_INTERFACE\r\nCGI/1.2\r\nHTTP_ACCEPT\r\n*/*\r\nHTTP_ACCEPT_ENCODING\r\ngzip, deflate\r\nHTTP_ACCEPT_LANGUAGE\r\nen;q=1\r\nHTTP_CONNECTION\r\nclose\r\nHTTP_HOST\r\nthrowdown.us\r\nHTTP_IF_NONE_MATCH\r\n\"xxxxx\"\r\nHTTP_USER_AGENT\r\nxxxxx\r\nHTTP_VERSION\r\nHTTP/1.0\r\nHTTP_X_FORWARDED_FOR\r\nxxxxx\r\nHTTP_X_FORWARDED_PROTO\r\nhttps\r\nHTTP_X_REAL_IP\r\nxxxxx\r\nORIGINAL_FULLPATH\r\n/users.json?token=xxxxx\r\nORIGINAL_SCRIPT_NAME\r\nPATH_INFO\r\n/users.json\r\nQUERY_STRING\r\ntoken=xxxxx\r\nREMOTE_ADDR\r\n127.0.0.1\r\nREQUEST_METHOD\r\nGET\r\nREQUEST_PATH\r\n/users.json\r\nREQUEST_URI\r\n/users.json?token=xxxxx\r\nROUTES_58746340_SCRIPT_NAME\r\nSCRIPT_NAME\r\nSERVER_NAME\r\nxxxxx\r\nSERVER_PORT\r\n443\r\nSERVER_PROTOCOL\r\nHTTP/1.1\r\nSERVER_SOFTWARE\r\n2.8.2\r\naction_dispatch.cookies_serializer\r\naction_dispatch.parameter_filter\r\n[\"password\"]\r\naction_dispatch.redirect_filter\r\n[]\r\naction_dispatch.remote_ip\r\nxxxxx\r\naction_dispatch.request_id\r\nxxxxx\r\naction_dispatch.show_detailed_exceptions\r\nfalse\r\naction_dispatch.show_exceptions\r\ntrue\r\nnewrelic.captured_request\r\ntrue\r\npuma.config\r\n#<Puma::Configuration:0x00000001c8f388>\r\npuma.socket\r\n#<UNIXSocket:0x007fa5ce044c70>\r\nrack.after_reply\r\n[]\r\nrack.hijack\r\n#<Puma::Client:0x007fa5ce044c48>\r\nrack.hijack?\r\ntrue\r\nrack.multiprocess\r\nfalse\r\nrack.multithread\r\ntrue\r\nrack.request.query_hash\r\n{\r\n  \"token\": \"xxxxx\"\r\n}\r\nrack.request.query_string\r\ntoken=xxxxx\r\nrack.run_once\r\nfalse\r\nrack.url_scheme\r\nhttp\r\nrack.version\r\n[\"1\", \"2\"]\r\n```\r\n\r\n\r\nBacktrace:\r\n```\r\n/gems/route_downcaser-0.2.2/lib/route_downcaser/downcase_route_middleware.rb:33 in \"uri_items\"\r\n/gems/route_downcaser-0.2.2/lib/route_downcaser/downcase_route_middleware.rb:37 in \"path\"\r\n/gems/route_downcaser-0.2.2/lib/route_downcaser/downcase_route_middleware.rb:46 in \"downcased_uri\"\r\n/gems/route_downcaser-0.2.2/lib/route_downcaser/downcase_route_middleware.rb:16 in \"call\"\r\n/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57 in \"call\"\r\n/gems/warden-1.2.3/lib/warden/manager.rb:35 in \"block in call\"\r\n/gems/warden-1.2.3/lib/warden/manager.rb:34 in \"catch\"\r\n/gems/warden-1.2.3/lib/warden/manager.rb:34 in \"call\"\r\n/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57 in \"call\"\r\n/gems/rack-1.5.2/lib/rack/etag.rb:23 in \"call\"\r\n/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57 in \"call\"\r\n/gems/rack-1.5.2/lib/rack/conditionalget.rb:25 in \"call\"\r\n/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57 in \"call\"\r\n/gems/rack-1.5.2/lib/rack/head.rb:11 in \"call\"\r\n/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57 in \"call\"\r\n/gems/actionpack-4.1.0/lib/action_dispatch/middleware/params_parser.rb:27 in \"call\"\r\n/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57 in \"call\"\r\n/gems/actionpack-4.1.0/lib/action_dispatch/middleware/flash.rb:254 in \"call\"\r\n/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57 in \"call\"\r\n/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:225 in \"context\"\r\n/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:220 in \"call\"\r\n/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57 in \"call\"\r\n/gems/actionpack-4.1.0/lib/action_dispatch/middleware/cookies.rb:560 in \"call\"\r\n/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57 in \"call\"\r\n/gems/activerecord-4.1.0/lib/active_record/query_cache.rb:36 in \"call\"\r\n/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57 in \"call\"\r\n/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:621 in \"call\"\r\n/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57 in \"call\"\r\n/gems/actionpack-4.1.0/lib/action_dispatch/middleware/callbacks.rb:29 in \"block in call\"\r\n/gems/activesupport-4.1.0/lib/active_support/callbacks.rb:82 in \"run_callbacks\"\r\n/gems/actionpack-4.1.0/lib/action_dispatch/middleware/callbacks.rb:27 in \"call\"\r\n/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57 in \"call\"\r\n/gems/actionpack-4.1.0/lib/action_dispatch/middleware/remote_ip.rb:76 in \"call\"\r\n/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57 in \"call\"\r\n/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57 in \"call\"\r\n/gems/actionpack-4.1.0/lib/action_dispatch/middleware/debug_exceptions.rb:17 in \"call\"\r\n/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57 in \"call\"\r\n/gems/actionpack-4.1.0/lib/action_dispatch/middleware/show_exceptions.rb:30 in \"call\"\r\n/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57 in \"call\"\r\n/gems/railties-4.1.0/lib/rails/rack/logger.rb:38 in \"call_app\"\r\n/gems/railties-4.1.0/lib/rails/rack/logger.rb:20 in \"block in call\"\r\n/gems/activesupport-4.1.0/lib/active_support/tagged_logging.rb:68 in \"block in tagged\"\r\n/gems/activesupport-4.1.0/lib/active_support/tagged_logging.rb:26 in \"tagged\"\r\n/gems/activesupport-4.1.0/lib/active_support/tagged_logging.rb:68 in \"tagged\"\r\n/gems/railties-4.1.0/lib/rails/rack/logger.rb:20 in \"call\"\r\n/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57 in \"call\"\r\n/gems/actionpack-4.1.0/lib/action_dispatch/middleware/request_id.rb:21 in \"call\"\r\n/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57 in \"call\"\r\n/gems/rack-1.5.2/lib/rack/methodoverride.rb:21 in \"call\"\r\n/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57 in \"call\"\r\n/gems/rack-1.5.2/lib/rack/runtime.rb:17 in \"call\"\r\n/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57 in \"call\"\r\n/gems/activesupport-4.1.0/lib/active_support/cache/strategy/local_cache_middleware.rb:26 in \"call\"\r\n/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57 in \"call\"\r\n/gems/rack-1.5.2/lib/rack/sendfile.rb:112 in \"call\"\r\n/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57 in \"call\"\r\n/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57 in \"call\"\r\n/gems/railties-4.1.0/lib/rails/engine.rb:514 in \"call\"\r\n/gems/railties-4.1.0/lib/rails/application.rb:144 in \"call\"\r\n/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57 in \"call\"\r\n/gems/puma-2.8.2/lib/puma/configuration.rb:71 in \"call\"\r\n/gems/puma-2.8.2/lib/puma/server.rb:490 in \"handle_request\"\r\n/gems/puma-2.8.2/lib/puma/server.rb:361 in \"process_client\"\r\n/gems/puma-2.8.2/lib/puma/server.rb:254 in \"block in run\"\r\n/gems/puma-2.8.2/lib/puma/thread_pool.rb:92 in \"call\"\r\n/gems/puma-2.8.2/lib/puma/thread_pool.rb:92 in \"block in spawn_thread\"\r\n```"},"comment":{"url":"https://api.github.com/repos/carstengehling/route_downcaser/issues/comments/74432667","html_url":"https://github.com/carstengehling/route_downcaser/issues/10#issuecomment-74432667","issue_url":"https://api.github.com/repos/carstengehling/route_downcaser/issues/10","id":74432667,"user":{"login":"carstengehling","id":54675,"avatar_url":"https://avatars.githubusercontent.com/u/54675?v=3","gravatar_id":"","url":"https://api.github.com/users/carstengehling","html_url":"https://github.com/carstengehling","followers_url":"https://api.github.com/users/carstengehling/followers","following_url":"https://api.github.com/users/carstengehling/following{/other_user}","gists_url":"https://api.github.com/users/carstengehling/gists{/gist_id}","starred_url":"https://api.github.com/users/carstengehling/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carstengehling/subscriptions","organizations_url":"https://api.github.com/users/carstengehling/orgs","repos_url":"https://api.github.com/users/carstengehling/repos","events_url":"https://api.github.com/users/carstengehling/events{/privacy}","received_events_url":"https://api.github.com/users/carstengehling/received_events","type":"User","site_admin":false},"created_at":"2015-02-15T19:34:28Z","updated_at":"2015-02-15T19:34:28Z","body":"And you did indeed, I just didn't use my eyes... :-)\r\n\r\nWell it's not a restriction as such. I just haven't setup tests with Rails 4.1, but AFAIK nothing major has changed in the middleware part.\r\n\r\nI have no problem with a check for nil values. IMHO it will make the module less brittle. I'll cook something up and release a minor version increment."}}