)]}'
{"src/util/http.js":[{"author":{"_account_id":8735,"name":"Vitaly Kramskikh","email":"vkramskikh@mirantis.com","username":"vkramskikh"},"change_message_id":"0f1df4a2768aeff161d770adefcdbd5cc74906fd","unresolved":false,"context_lines":[{"line_number":87,"context_line":"   * @param {{}} body The body. It will be JSON-Encoded by the handler."},{"line_number":88,"context_line":"   * @returns {Promise} A promise which will resolve with the processed request response."},{"line_number":89,"context_line":"   */"},{"line_number":90,"context_line":"  httpRequest (method, url, headers, body) {"},{"line_number":91,"context_line":"    headers \u003d headers || {};"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    // Sanitize the headers..."}],"source_content_type":"text/javascript","patch_set":3,"id":"3ac371cc_66b58e7c","line":90,"range":{"start_line":90,"start_character":28,"end_line":90,"end_character":35},"updated":"2016-08-18 13:00:35.000000000","message":"ES6 default parameters could be useful here:\n\n  headers \u003d {}","commit_id":"b102fa78bcfdc2688d2399cb877c01351bf0ef58"},{"author":{"_account_id":8735,"name":"Vitaly Kramskikh","email":"vkramskikh@mirantis.com","username":"vkramskikh"},"change_message_id":"0f1df4a2768aeff161d770adefcdbd5cc74906fd","unresolved":false,"context_lines":[{"line_number":91,"context_line":"    headers \u003d headers || {};"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    // Sanitize the headers..."},{"line_number":94,"context_line":"    headers \u003d Object.assign(headers, this.defaultHeaders);"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"    // Build the request"},{"line_number":97,"context_line":"    const init \u003d {"}],"source_content_type":"text/javascript","patch_set":3,"id":"3ac371cc_865c0a4c","line":94,"updated":"2016-08-18 13:00:35.000000000","message":"You should probably use\n\n Object.assign({}, headers, this.defaultHeaders);\n\nto avoid mutation of original headers parameter","commit_id":"b102fa78bcfdc2688d2399cb877c01351bf0ef58"},{"author":{"_account_id":8735,"name":"Vitaly Kramskikh","email":"vkramskikh@mirantis.com","username":"vkramskikh"},"change_message_id":"0f1df4a2768aeff161d770adefcdbd5cc74906fd","unresolved":false,"context_lines":[{"line_number":97,"context_line":"    const init \u003d {"},{"line_number":98,"context_line":"      method: method,"},{"line_number":99,"context_line":"      headers: headers"},{"line_number":100,"context_line":"    };"},{"line_number":101,"context_line":"    // The Request() constructor will throw an error if the method is GET/HEAD and there\u0027s a body."},{"line_number":102,"context_line":"    if ([\u0027GET\u0027, \u0027HEAD\u0027].indexOf(method) \u003d\u003d\u003d -1 \u0026\u0026 body) {"},{"line_number":103,"context_line":"      init.body \u003d JSON.stringify(body);"}],"source_content_type":"text/javascript","patch_set":3,"id":"3ac371cc_89389dd4","line":100,"updated":"2016-08-18 13:00:35.000000000","message":"ES6 Object shorthands could be useful here","commit_id":"b102fa78bcfdc2688d2399cb877c01351bf0ef58"},{"author":{"_account_id":8735,"name":"Vitaly Kramskikh","email":"vkramskikh@mirantis.com","username":"vkramskikh"},"change_message_id":"0f1df4a2768aeff161d770adefcdbd5cc74906fd","unresolved":false,"context_lines":[{"line_number":99,"context_line":"      headers: headers"},{"line_number":100,"context_line":"    };"},{"line_number":101,"context_line":"    // The Request() constructor will throw an error if the method is GET/HEAD and there\u0027s a body."},{"line_number":102,"context_line":"    if ([\u0027GET\u0027, \u0027HEAD\u0027].indexOf(method) \u003d\u003d\u003d -1 \u0026\u0026 body) {"},{"line_number":103,"context_line":"      init.body \u003d JSON.stringify(body);"},{"line_number":104,"context_line":"    }"},{"line_number":105,"context_line":"    const request \u003d new Request(url, init);"}],"source_content_type":"text/javascript","patch_set":3,"id":"3ac371cc_893ffdb2","line":102,"updated":"2016-08-18 13:00:35.000000000","message":"What about DELETE method? AFAIR DELETE request also shouldn\u0027t have body","commit_id":"b102fa78bcfdc2688d2399cb877c01351bf0ef58"},{"author":{"_account_id":9717,"name":"Michael Krotscheck","email":"krotscheck@gmail.com","username":"krotscheck"},"change_message_id":"9376a5cc40872802b5156f97cc6491355b5c9e40","unresolved":false,"context_lines":[{"line_number":99,"context_line":"      headers: headers"},{"line_number":100,"context_line":"    };"},{"line_number":101,"context_line":"    // The Request() constructor will throw an error if the method is GET/HEAD and there\u0027s a body."},{"line_number":102,"context_line":"    if ([\u0027GET\u0027, \u0027HEAD\u0027].indexOf(method) \u003d\u003d\u003d -1 \u0026\u0026 body) {"},{"line_number":103,"context_line":"      init.body \u003d JSON.stringify(body);"},{"line_number":104,"context_line":"    }"},{"line_number":105,"context_line":"    const request \u003d new Request(url, init);"}],"source_content_type":"text/javascript","patch_set":3,"id":"3ac371cc_4c93415b","line":102,"in_reply_to":"3ac371cc_893ffdb2","updated":"2016-08-18 20:14:08.000000000","message":"The HTTP spec is not specific on whether DELETE (or, for that matter GET) methods should or should not have any kind of body. The above line is there to circumvent an error thrown by the Request() constructor.","commit_id":"b102fa78bcfdc2688d2399cb877c01351bf0ef58"}],"test/unit/keystoneTest.js":[{"author":{"_account_id":8735,"name":"Vitaly Kramskikh","email":"vkramskikh@mirantis.com","username":"vkramskikh"},"change_message_id":"0f1df4a2768aeff161d770adefcdbd5cc74906fd","unresolved":false,"context_lines":[{"line_number":1,"context_line":""},{"line_number":2,"context_line":"import \u0027isomorphic-fetch\u0027;"},{"line_number":3,"context_line":"import Keystone from \u0027../../src/keystone.js\u0027;"},{"line_number":4,"context_line":"import fetchMock from \u0027fetch-mock\u0027;"},{"line_number":5,"context_line":""}],"source_content_type":"text/javascript","patch_set":3,"id":"3ac371cc_a6578656","line":2,"updated":"2016-08-18 13:00:35.000000000","message":"Import of isomorphic-fetch should go to keystone client, not here","commit_id":"b102fa78bcfdc2688d2399cb877c01351bf0ef58"}],"test/unit/util/httpTest.js":[{"author":{"_account_id":8735,"name":"Vitaly Kramskikh","email":"vkramskikh@mirantis.com","username":"vkramskikh"},"change_message_id":"0f1df4a2768aeff161d770adefcdbd5cc74906fd","unresolved":false,"context_lines":[{"line_number":133,"context_line":"    http.requestInterceptors.push((request) \u003d\u003e {"},{"line_number":134,"context_line":"      request.headers.promise \u003d true;"},{"line_number":135,"context_line":"      return Promise.resolve(request);"},{"line_number":136,"context_line":"    });"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"    http.httpGet(testUrl)"},{"line_number":139,"context_line":"      .then(() \u003d\u003e {"}],"source_content_type":"text/javascript","patch_set":3,"id":"3ac371cc_40e66fe8","line":136,"updated":"2016-08-18 13:00:35.000000000","message":"Not sure if testing a simple value and wrapped into Promise adds any value - it\u0027s actually testing of promises, not the HTTP helper","commit_id":"b102fa78bcfdc2688d2399cb877c01351bf0ef58"},{"author":{"_account_id":9717,"name":"Michael Krotscheck","email":"krotscheck@gmail.com","username":"krotscheck"},"change_message_id":"9376a5cc40872802b5156f97cc6491355b5c9e40","unresolved":false,"context_lines":[{"line_number":133,"context_line":"    http.requestInterceptors.push((request) \u003d\u003e {"},{"line_number":134,"context_line":"      request.headers.promise \u003d true;"},{"line_number":135,"context_line":"      return Promise.resolve(request);"},{"line_number":136,"context_line":"    });"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"    http.httpGet(testUrl)"},{"line_number":139,"context_line":"      .then(() \u003d\u003e {"}],"source_content_type":"text/javascript","patch_set":3,"id":"3ac371cc_217359e9","line":136,"in_reply_to":"3ac371cc_40e66fe8","updated":"2016-08-18 20:14:08.000000000","message":"It tests the promise chain loop- about 1% extra coverage.","commit_id":"b102fa78bcfdc2688d2399cb877c01351bf0ef58"}]}
