{"action":"created","issue":{"url":"https://api.github.com/repos/sstephenson/prototype/issues/150","labels_url":"https://api.github.com/repos/sstephenson/prototype/issues/150/labels{/name}","comments_url":"https://api.github.com/repos/sstephenson/prototype/issues/150/comments","events_url":"https://api.github.com/repos/sstephenson/prototype/issues/150/events","html_url":"https://github.com/sstephenson/prototype/issues/150","id":31945396,"number":150,"title":"Prototype add extra parameter on Ajax Requests made from Google Chrome using Post","user":{"login":"jwestbrook","id":2723191,"avatar_url":"https://avatars.githubusercontent.com/u/2723191?v=3","gravatar_id":"","url":"https://api.github.com/users/jwestbrook","html_url":"https://github.com/jwestbrook","followers_url":"https://api.github.com/users/jwestbrook/followers","following_url":"https://api.github.com/users/jwestbrook/following{/other_user}","gists_url":"https://api.github.com/users/jwestbrook/gists{/gist_id}","starred_url":"https://api.github.com/users/jwestbrook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwestbrook/subscriptions","organizations_url":"https://api.github.com/users/jwestbrook/orgs","repos_url":"https://api.github.com/users/jwestbrook/repos","events_url":"https://api.github.com/users/jwestbrook/events{/privacy}","received_events_url":"https://api.github.com/users/jwestbrook/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/sstephenson/prototype/labels/bug","name":"bug","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2014-04-22T04:53:56Z","updated_at":"2015-05-13T04:23:36Z","closed_at":null,"body":"[previous lighthouse ticket #1399](https://prototype.lighthouseapp.com/projects/8886/tickets/1399-prototype-add-extra-parameter-on-ajax-requests-made-from-google-chrome-using-post) \r\nby Pablo Biscayart \r\n\r\n***\r\n\r\nFrom the Javascript code in my web application, I do the following call:\r\n```\r\nrequest = new Ajax.Request(url, { method: \"POST\", parameters: qstring, onComplete: Process_Response } );\r\n```\r\nAssuming that the url and qstring are correct (the call works fine and work on Firefox), the flow will lead to Ajax.Request in prototype, which contains the following lines:\r\n\r\n```\r\nif (params = Object.toQueryString(params)) {\r\n\r\n  // when GET, append parameters to URL\r\n  if (this.method == 'get')\r\n    this.url += (this.url.include('?') ? '&' : '?') + params;\r\n  else if (/Konqueror|Safari|KHTML/.test(navigator.userAgent))\r\n    params += '&_=';\r\n}\r\n```\r\nThis code adds an extra parameter (\"_\") to the query string when using Chrome, and when the flow reaches the following (located below in a try-catch block after the previous code):\r\n\r\n```\r\nthis.body = this.method == 'post' ? (this.options.postBody || params) : null;\r\nthis.transport.send(this.body);\r\n```\r\nthe call to the URL will fail due to signature mismatch, and my web app stops working. That hard-wiring of the browser names is pretty ugly indeed. Is this solvable in a way that you don't discriminate among browsers?\r\nThis looks the same in 1.6.0 and 1.6.0.2. If I was not clear enough, please contact me and accept my apologies.\r\n\r\nThank you,\r\nPablo"},"comment":{"url":"https://api.github.com/repos/sstephenson/prototype/issues/comments/101509444","html_url":"https://github.com/sstephenson/prototype/issues/150#issuecomment-101509444","issue_url":"https://api.github.com/repos/sstephenson/prototype/issues/150","id":101509444,"user":{"login":"savetheclocktower","id":3450,"avatar_url":"https://avatars.githubusercontent.com/u/3450?v=3","gravatar_id":"","url":"https://api.github.com/users/savetheclocktower","html_url":"https://github.com/savetheclocktower","followers_url":"https://api.github.com/users/savetheclocktower/followers","following_url":"https://api.github.com/users/savetheclocktower/following{/other_user}","gists_url":"https://api.github.com/users/savetheclocktower/gists{/gist_id}","starred_url":"https://api.github.com/users/savetheclocktower/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/savetheclocktower/subscriptions","organizations_url":"https://api.github.com/users/savetheclocktower/orgs","repos_url":"https://api.github.com/users/savetheclocktower/repos","events_url":"https://api.github.com/users/savetheclocktower/events{/privacy}","received_events_url":"https://api.github.com/users/savetheclocktower/received_events","type":"User","site_admin":false},"created_at":"2015-05-13T04:23:36Z","updated_at":"2015-05-13T04:23:36Z","body":"We do really need to investigate why the hell we're still adding that `&_=` to the end of all URLs in the year 2015."}}