{"action":"created","issue":{"url":"https://api.github.com/repos/pearsontechnology/kong-rewrite-plugin/issues/3","repository_url":"https://api.github.com/repos/pearsontechnology/kong-rewrite-plugin","labels_url":"https://api.github.com/repos/pearsontechnology/kong-rewrite-plugin/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/pearsontechnology/kong-rewrite-plugin/issues/3/comments","events_url":"https://api.github.com/repos/pearsontechnology/kong-rewrite-plugin/issues/3/events","html_url":"https://github.com/pearsontechnology/kong-rewrite-plugin/issues/3","id":370343472,"node_id":"MDU6SXNzdWUzNzAzNDM0NzI=","number":3,"title":"Plugin broken since Kong 0.11 - request rewrite method changed","user":{"login":"jdevalk2","id":37546486,"node_id":"MDQ6VXNlcjM3NTQ2NDg2","avatar_url":"https://avatars2.githubusercontent.com/u/37546486?v=4","gravatar_id":"","url":"https://api.github.com/users/jdevalk2","html_url":"https://github.com/jdevalk2","followers_url":"https://api.github.com/users/jdevalk2/followers","following_url":"https://api.github.com/users/jdevalk2/following{/other_user}","gists_url":"https://api.github.com/users/jdevalk2/gists{/gist_id}","starred_url":"https://api.github.com/users/jdevalk2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdevalk2/subscriptions","organizations_url":"https://api.github.com/users/jdevalk2/orgs","repos_url":"https://api.github.com/users/jdevalk2/repos","events_url":"https://api.github.com/users/jdevalk2/events{/privacy}","received_events_url":"https://api.github.com/users/jdevalk2/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-10-15T21:05:08Z","updated_at":"2019-01-04T19:21:46Z","closed_at":null,"author_association":"NONE","body":"\r\nThe plugin uses req_set_uri (request_access.lua), however this was deprecated since Kong 0.11\r\n\r\nThe current correct way to set the URI is:  ngx.var.upstream_uri = uri \r\n\r\nAs per:\r\n\r\nhttps://discuss.konghq.com/t/changing-upstream-url/261\r\n"},"comment":{"url":"https://api.github.com/repos/pearsontechnology/kong-rewrite-plugin/issues/comments/451541891","html_url":"https://github.com/pearsontechnology/kong-rewrite-plugin/issues/3#issuecomment-451541891","issue_url":"https://api.github.com/repos/pearsontechnology/kong-rewrite-plugin/issues/3","id":451541891,"node_id":"MDEyOklzc3VlQ29tbWVudDQ1MTU0MTg5MQ==","user":{"login":"jdevalk2","id":37546486,"node_id":"MDQ6VXNlcjM3NTQ2NDg2","avatar_url":"https://avatars2.githubusercontent.com/u/37546486?v=4","gravatar_id":"","url":"https://api.github.com/users/jdevalk2","html_url":"https://github.com/jdevalk2","followers_url":"https://api.github.com/users/jdevalk2/followers","following_url":"https://api.github.com/users/jdevalk2/following{/other_user}","gists_url":"https://api.github.com/users/jdevalk2/gists{/gist_id}","starred_url":"https://api.github.com/users/jdevalk2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdevalk2/subscriptions","organizations_url":"https://api.github.com/users/jdevalk2/orgs","repos_url":"https://api.github.com/users/jdevalk2/repos","events_url":"https://api.github.com/users/jdevalk2/events{/privacy}","received_events_url":"https://api.github.com/users/jdevalk2/received_events","type":"User","site_admin":false},"created_at":"2019-01-04T19:21:46Z","updated_at":"2019-01-04T19:21:46Z","author_association":"NONE","body":"I just merged the latest code and the transform path is still broken.\r\nCan't get it to set the Url proper unless I have the code like this:\r\n\r\nIn my configuration I have Key Authentication plugin on the same route. If the key validation fails, and I am using the code as-is, the resulting behavior is Empty Result (server closes connection)\r\n\r\nIf I change it to the code below, it works. I think this is due to the way Key Auth terminates the request, though I havent dug to deep into it.\r\n\r\n```\r\nlocal function transform_path(conf, scope)\r\n  if isempty(conf.request.path) then\r\n    return\r\n  end\r\n  local uri = mapTo(scope, conf.request.path)\r\n  if uri then\r\n    ngx.var.upstream_uri = uri \r\n--    req_set_uri(uri)\r\n  end\r\nend\r\n```"}}
{"actor":{"display_login":"jdevalk2"}}