{"action":"created","issue":{"url":"https://api.github.com/repos/pgte/nock/issues/372","labels_url":"https://api.github.com/repos/pgte/nock/issues/372/labels{/name}","comments_url":"https://api.github.com/repos/pgte/nock/issues/372/comments","events_url":"https://api.github.com/repos/pgte/nock/issues/372/events","html_url":"https://github.com/pgte/nock/pull/372","id":108163800,"number":372,"title":"Fix query() unpassed param issue","user":{"login":"jshcrowthe","id":5588878,"avatar_url":"https://avatars.githubusercontent.com/u/5588878?v=3","gravatar_id":"","url":"https://api.github.com/users/jshcrowthe","html_url":"https://github.com/jshcrowthe","followers_url":"https://api.github.com/users/jshcrowthe/followers","following_url":"https://api.github.com/users/jshcrowthe/following{/other_user}","gists_url":"https://api.github.com/users/jshcrowthe/gists{/gist_id}","starred_url":"https://api.github.com/users/jshcrowthe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jshcrowthe/subscriptions","organizations_url":"https://api.github.com/users/jshcrowthe/orgs","repos_url":"https://api.github.com/users/jshcrowthe/repos","events_url":"https://api.github.com/users/jshcrowthe/events{/privacy}","received_events_url":"https://api.github.com/users/jshcrowthe/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-24T16:16:24Z","updated_at":"2015-09-25T15:09:50Z","closed_at":"2015-09-25T12:04:19Z","pull_request":{"url":"https://api.github.com/repos/pgte/nock/pulls/372","html_url":"https://github.com/pgte/nock/pull/372","diff_url":"https://github.com/pgte/nock/pull/372.diff","patch_url":"https://github.com/pgte/nock/pull/372.patch"},"body":"This is a fix for a small bug I found in the `query()` handler.\r\n\r\nCurrently the `query()` option (if passed an `Object`) loops through all passed values and compares them against a set of expected values. This will throw a false positive if the user passes fewer values than expected but all of them match the expected params.\r\n\r\nFor example, if setup as follows:\r\n```javascript\r\nvar scope = nock('http://google.com')\r\n    .get('/')\r\n    .query({\r\n      num:1,\r\n      str:'fou'\r\n    })\r\n    .reply(200);\r\n```\r\n\r\nThe following requests will all match:\r\n```\r\nhttp://google.com?num=1\r\nhttp://google.com?str=fou\r\nhttp://google.com?str=fou&num=1\r\n```\r\n\r\nBy checking that there is an equal number of expected and passed params we can at preempt any unnecessary comparison and catch some false positives. "},"comment":{"url":"https://api.github.com/repos/pgte/nock/issues/comments/143248152","html_url":"https://github.com/pgte/nock/pull/372#issuecomment-143248152","issue_url":"https://api.github.com/repos/pgte/nock/issues/372","id":143248152,"user":{"login":"jshcrowthe","id":5588878,"avatar_url":"https://avatars.githubusercontent.com/u/5588878?v=3","gravatar_id":"","url":"https://api.github.com/users/jshcrowthe","html_url":"https://github.com/jshcrowthe","followers_url":"https://api.github.com/users/jshcrowthe/followers","following_url":"https://api.github.com/users/jshcrowthe/following{/other_user}","gists_url":"https://api.github.com/users/jshcrowthe/gists{/gist_id}","starred_url":"https://api.github.com/users/jshcrowthe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jshcrowthe/subscriptions","organizations_url":"https://api.github.com/users/jshcrowthe/orgs","repos_url":"https://api.github.com/users/jshcrowthe/repos","events_url":"https://api.github.com/users/jshcrowthe/events{/privacy}","received_events_url":"https://api.github.com/users/jshcrowthe/received_events","type":"User","site_admin":false},"created_at":"2015-09-25T15:09:50Z","updated_at":"2015-09-25T15:09:50Z","body":"@pgte Thanks a bunch for reviewing!"}}