{"action":"created","issue":{"url":"https://api.github.com/repos/ruby-grape/grape/issues/453","repository_url":"https://api.github.com/repos/ruby-grape/grape","labels_url":"https://api.github.com/repos/ruby-grape/grape/issues/453/labels{/name}","comments_url":"https://api.github.com/repos/ruby-grape/grape/issues/453/comments","events_url":"https://api.github.com/repos/ruby-grape/grape/issues/453/events","html_url":"https://github.com/ruby-grape/grape/issues/453","id":17726492,"number":453,"title":"Presence of '.' characters in URI confuses Grape","user":{"login":"supriyapjoshi","id":219955,"avatar_url":"https://avatars.githubusercontent.com/u/219955?v=3","gravatar_id":"","url":"https://api.github.com/users/supriyapjoshi","html_url":"https://github.com/supriyapjoshi","followers_url":"https://api.github.com/users/supriyapjoshi/followers","following_url":"https://api.github.com/users/supriyapjoshi/following{/other_user}","gists_url":"https://api.github.com/users/supriyapjoshi/gists{/gist_id}","starred_url":"https://api.github.com/users/supriyapjoshi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/supriyapjoshi/subscriptions","organizations_url":"https://api.github.com/users/supriyapjoshi/orgs","repos_url":"https://api.github.com/users/supriyapjoshi/repos","events_url":"https://api.github.com/users/supriyapjoshi/events{/privacy}","received_events_url":"https://api.github.com/users/supriyapjoshi/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ruby-grape/grape/labels/bug?","name":"bug?","color":"d7e102"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":16,"created_at":"2013-08-07T02:02:13Z","updated_at":"2016-10-10T16:27:33Z","closed_at":"2014-01-14T12:13:01Z","body":"Given the following Grape API:\r\n\r\n    require 'grape/api'\r\n\r\n    class IndexApi < Grape::API\r\n      content_type :html, 'text/html'\r\n      content_type :json, 'application/json'\r\n\r\n      default_format :json\r\n\r\n      allow_cross_domain_request_from '*'\r\n\r\n      get '/notes/:component_name' do\r\n        \"#{params[:component_name]}\"\r\n      end\r\n    end\r\n\r\nHere are the results of GETting various URIs:\r\n\r\n * `/notes/foo` returns `\"foo\"`\r\n * `/notes/http%3A%2F%2Fwww%2Eexample` returns `\"http://www\"`\r\n * `/notes/http%3A%2F%2Fwww%2Eexample.com` returns a 404 Not Found\r\n\r\nI would expect the results to be:\r\n\r\n * `/notes/foo` returns `\"foo\"`\r\n * `/notes/http%3A%2F%2Fwww%2Eexample` returns `\"http://www.example\"`\r\n * `/notes/http%3A%2F%2Fwww%2Eexample.com` returns `\"http://www.example.com\"`\r\n"},"comment":{"url":"https://api.github.com/repos/ruby-grape/grape/issues/comments/252671425","html_url":"https://github.com/ruby-grape/grape/issues/453#issuecomment-252671425","issue_url":"https://api.github.com/repos/ruby-grape/grape/issues/453","id":252671425,"user":{"login":"atomless","id":28726,"avatar_url":"https://avatars.githubusercontent.com/u/28726?v=3","gravatar_id":"","url":"https://api.github.com/users/atomless","html_url":"https://github.com/atomless","followers_url":"https://api.github.com/users/atomless/followers","following_url":"https://api.github.com/users/atomless/following{/other_user}","gists_url":"https://api.github.com/users/atomless/gists{/gist_id}","starred_url":"https://api.github.com/users/atomless/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atomless/subscriptions","organizations_url":"https://api.github.com/users/atomless/orgs","repos_url":"https://api.github.com/users/atomless/repos","events_url":"https://api.github.com/users/atomless/events{/privacy}","received_events_url":"https://api.github.com/users/atomless/received_events","type":"User","site_admin":false},"created_at":"2016-10-10T16:27:33Z","updated_at":"2016-10-10T16:27:33Z","body":"```Ruby\r\nrequire 'rubygems'\r\nrequire 'rack/test'\r\nrequire 'test/unit'\r\n\r\nOUTER_APP = Rack::Builder.parse_file('config.ru').first\r\n\r\nclass TestApp < Test::Unit::TestCase\r\n  include Rack::Test::Methods\r\n\r\n  def app\r\n    OUTER_APP\r\n  end\r\n \r\n  def test1\r\n    get 'api/v1/thing/by_key/foo'\r\n    puts \"#{last_response.body}\"\r\n    assert last_response.ok?\r\n  end\r\n\r\n  def test2\r\n    get '/thing/by_key/www.wizz.bang.com'\r\n    puts \"#{last_response.body}\"\r\n    assert last_response.ok?\r\n  end\r\nend\r\n```\r\nThe endpoint targeted by this is simply:\r\n```Ruby\r\nparams do\r\n    requires :key, :type => String, desc: 'URL encoded UNIQUE key string identifier .'\r\nend\r\nget 'by_key/*key' do\r\n   self.params[:key]\r\nend\r\n```\r\ntest1 passes and returns 'foo' and test2 is always a 404."}}
{"actor":{"display_login":"atomless"}}