зеркало из https://github.com/electron/electron.git
1 строка
19 KiB
Plaintext
1 строка
19 KiB
Plaintext
{"status":200,"url":"https://api.github.com/repos/electron/electron/commits/2955c67c4ea712fa22773ac9113709fc952bfd49/pulls","headers":{"access-control-allow-origin":"*","access-control-expose-headers":"ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset","cache-control":"private, max-age=60, s-maxage=60","connection":"close","content-encoding":"gzip","content-security-policy":"default-src 'none'","content-type":"application/json; charset=utf-8","date":"Tue, 26 May 2020 16:25:38 GMT","etag":"W/\"7be19eed3b62d434bcbc8ed63e9c6fe9\"","referrer-policy":"origin-when-cross-origin, strict-origin-when-cross-origin","server":"GitHub.com","status":"200 OK","strict-transport-security":"max-age=31536000; includeSubdomains; preload","transfer-encoding":"chunked","vary":"Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding, Accept, X-Requested-With","x-accepted-oauth-scopes":"","x-content-type-options":"nosniff","x-frame-options":"deny","x-github-media-type":"github.groot-preview; format=json","x-github-request-id":"CC2A:2EDB:AF2650:12289C2:5ECD4301","x-oauth-scopes":"repo","x-ratelimit-limit":"5000","x-ratelimit-remaining":"4975","x-ratelimit-reset":"1590510696","x-xss-protection":"1; mode=block"},"data":{"url":"https://api.github.com/repos/electron/electron/pulls/21946","id":368254138,"node_id":"MDExOlB1bGxSZXF1ZXN0MzY4MjU0MTM4","html_url":"https://github.com/electron/electron/pull/21946","diff_url":"https://github.com/electron/electron/pull/21946.diff","patch_url":"https://github.com/electron/electron/pull/21946.patch","issue_url":"https://api.github.com/repos/electron/electron/issues/21946","number":21946,"state":"closed","locked":false,"title":"fix: prevent print crash on bad deviceName","user":{"login":"codebytere","id":2036040,"node_id":"MDQ6VXNlcjIwMzYwNDA=","avatar_url":"https://avatars2.githubusercontent.com/u/2036040?v=4","gravatar_id":"","url":"https://api.github.com/users/codebytere","html_url":"https://github.com/codebytere","followers_url":"https://api.github.com/users/codebytere/followers","following_url":"https://api.github.com/users/codebytere/following{/other_user}","gists_url":"https://api.github.com/users/codebytere/gists{/gist_id}","starred_url":"https://api.github.com/users/codebytere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codebytere/subscriptions","organizations_url":"https://api.github.com/users/codebytere/orgs","repos_url":"https://api.github.com/users/codebytere/repos","events_url":"https://api.github.com/users/codebytere/events{/privacy}","received_events_url":"https://api.github.com/users/codebytere/received_events","type":"User","site_admin":true},"body":"#### Description of Change\r\n\r\nOn [Windows](https://source.chromium.org/chromium/chromium/src/+/master:printing/printing_context_win.cc;l=157?originalUrl=https:%2F%2Fcs.chromium.org%2F) and [macOS](https://source.chromium.org/chromium/chromium/src/+/master:printing/printing_context_mac.mm;l=226?originalUrl=https:%2F%2Fcs.chromium.org%2F), Chromium's printing code will crash if a `deviceName` is provided, but is invalid on the network, i.e does not correspond to a printer that the caller machine is aware of. This bug has been present for a long time, but after playing around a bit I've determined that it's possible to catch faulty `deviceName`s by pulling out some of the printer validation code from Chromium. This PR adds that check for Windows and macOS as well as tests for the same.\r\n\r\nTested with:\r\n```js\r\nwin.webContents.on('did-finish-load', () => {\r\n win.webContents.print({deviceName: 'bad-printer-name'}, (success, reason) => {\r\n console.log(`printing ${success ? 'did' : 'did not'} succeed: ${reason}`)\r\n })\r\n})\r\n```\r\n\r\ncc @ckerr @zcbenz \r\n\r\n#### Checklist\r\n<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->\r\n\r\n- [x] PR description included and stakeholders cc'd\r\n- [x] `npm test` passes\r\n- [x] tests are [changed or added](https://github.com/electron/electron/blob/master/docs/development/testing.md)\r\n- [x] relevant documentation is changed or added\r\n- [x] PR title follows semantic [commit guidelines](https://github.com/electron/electron/blob/master/docs/development/pull-requests.md#commit-message-guidelines)\r\n- [x] [PR release notes](https://github.com/electron/clerk/blob/master/README.md) describe the change in a way relevant to app developers, and are [capitalized, punctuated, and past tense](https://github.com/electron/clerk/blob/master/README.md#examples).\r\n\r\n#### Release Notes\r\n\r\nNotes: Fixed a potential crash on faulty `deviceName`s in `webContents.print()`.\r\n","created_at":"2020-01-28T22:02:08Z","updated_at":"2020-05-18T18:15:29Z","closed_at":"2020-01-31T02:49:14Z","merged_at":"2020-01-31T02:49:14Z","merge_commit_sha":"2955c67c4ea712fa22773ac9113709fc952bfd49","assignee":null,"assignees":[],"requested_reviewers":[{"login":"ckerr","id":70381,"node_id":"MDQ6VXNlcjcwMzgx","avatar_url":"https://avatars3.githubusercontent.com/u/70381?v=4","gravatar_id":"","url":"https://api.github.com/users/ckerr","html_url":"https://github.com/ckerr","followers_url":"https://api.github.com/users/ckerr/followers","following_url":"https://api.github.com/users/ckerr/following{/other_user}","gists_url":"https://api.github.com/users/ckerr/gists{/gist_id}","starred_url":"https://api.github.com/users/ckerr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ckerr/subscriptions","organizations_url":"https://api.github.com/users/ckerr/orgs","repos_url":"https://api.github.com/users/ckerr/repos","events_url":"https://api.github.com/users/ckerr/events{/privacy}","received_events_url":"https://api.github.com/users/ckerr/received_events","type":"User","site_admin":true}],"requested_teams":[],"labels":[{"id":1657635084,"node_id":"MDU6TGFiZWwxNjU3NjM1MDg0","url":"https://api.github.com/repos/electron/electron/labels/merged/7-1-x","name":"merged/7-1-x","color":"61a3c6","default":false,"description":"PR was merged to the \"7-1-x\" branch."},{"id":1634462328,"node_id":"MDU6TGFiZWwxNjM0NDYyMzI4","url":"https://api.github.com/repos/electron/electron/labels/merged/8-x-y","name":"merged/8-x-y","color":"61a3c6","default":false,"description":"PR was merged to the \"8-x-y\" branch."}],"milestone":null,"draft":false,"commits_url":"https://api.github.com/repos/electron/electron/pulls/21946/commits","review_comments_url":"https://api.github.com/repos/electron/electron/pulls/21946/comments","review_comment_url":"https://api.github.com/repos/electron/electron/pulls/comments{/number}","comments_url":"https://api.github.com/repos/electron/electron/issues/21946/comments","statuses_url":"https://api.github.com/repos/electron/electron/statuses/858dbc690b159ecf767e6ae55e476f73ead931f6","head":{"label":"electron:sanity-check-devicename","ref":"sanity-check-devicename","sha":"858dbc690b159ecf767e6ae55e476f73ead931f6","user":{"login":"electron","id":13409222,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDA5MjIy","avatar_url":"https://avatars1.githubusercontent.com/u/13409222?v=4","gravatar_id":"","url":"https://api.github.com/users/electron","html_url":"https://github.com/electron","followers_url":"https://api.github.com/users/electron/followers","following_url":"https://api.github.com/users/electron/following{/other_user}","gists_url":"https://api.github.com/users/electron/gists{/gist_id}","starred_url":"https://api.github.com/users/electron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron/subscriptions","organizations_url":"https://api.github.com/users/electron/orgs","repos_url":"https://api.github.com/users/electron/repos","events_url":"https://api.github.com/users/electron/events{/privacy}","received_events_url":"https://api.github.com/users/electron/received_events","type":"Organization","site_admin":false},"repo":{"id":9384267,"node_id":"MDEwOlJlcG9zaXRvcnk5Mzg0MjY3","name":"electron","full_name":"electron/electron","private":false,"owner":{"login":"electron","id":13409222,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDA5MjIy","avatar_url":"https://avatars1.githubusercontent.com/u/13409222?v=4","gravatar_id":"","url":"https://api.github.com/users/electron","html_url":"https://github.com/electron","followers_url":"https://api.github.com/users/electron/followers","following_url":"https://api.github.com/users/electron/following{/other_user}","gists_url":"https://api.github.com/users/electron/gists{/gist_id}","starred_url":"https://api.github.com/users/electron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron/subscriptions","organizations_url":"https://api.github.com/users/electron/orgs","repos_url":"https://api.github.com/users/electron/repos","events_url":"https://api.github.com/users/electron/events{/privacy}","received_events_url":"https://api.github.com/users/electron/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/electron/electron","description":":electron: Build cross-platform desktop apps with JavaScript, HTML, and CSS","fork":false,"url":"https://api.github.com/repos/electron/electron","forks_url":"https://api.github.com/repos/electron/electron/forks","keys_url":"https://api.github.com/repos/electron/electron/keys{/key_id}","collaborators_url":"https://api.github.com/repos/electron/electron/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/electron/electron/teams","hooks_url":"https://api.github.com/repos/electron/electron/hooks","issue_events_url":"https://api.github.com/repos/electron/electron/issues/events{/number}","events_url":"https://api.github.com/repos/electron/electron/events","assignees_url":"https://api.github.com/repos/electron/electron/assignees{/user}","branches_url":"https://api.github.com/repos/electron/electron/branches{/branch}","tags_url":"https://api.github.com/repos/electron/electron/tags","blobs_url":"https://api.github.com/repos/electron/electron/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/electron/electron/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/electron/electron/git/refs{/sha}","trees_url":"https://api.github.com/repos/electron/electron/git/trees{/sha}","statuses_url":"https://api.github.com/repos/electron/electron/statuses/{sha}","languages_url":"https://api.github.com/repos/electron/electron/languages","stargazers_url":"https://api.github.com/repos/electron/electron/stargazers","contributors_url":"https://api.github.com/repos/electron/electron/contributors","subscribers_url":"https://api.github.com/repos/electron/electron/subscribers","subscription_url":"https://api.github.com/repos/electron/electron/subscription","commits_url":"https://api.github.com/repos/electron/electron/commits{/sha}","git_commits_url":"https://api.github.com/repos/electron/electron/git/commits{/sha}","comments_url":"https://api.github.com/repos/electron/electron/comments{/number}","issue_comment_url":"https://api.github.com/repos/electron/electron/issues/comments{/number}","contents_url":"https://api.github.com/repos/electron/electron/contents/{+path}","compare_url":"https://api.github.com/repos/electron/electron/compare/{base}...{head}","merges_url":"https://api.github.com/repos/electron/electron/merges","archive_url":"https://api.github.com/repos/electron/electron/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/electron/electron/downloads","issues_url":"https://api.github.com/repos/electron/electron/issues{/number}","pulls_url":"https://api.github.com/repos/electron/electron/pulls{/number}","milestones_url":"https://api.github.com/repos/electron/electron/milestones{/number}","notifications_url":"https://api.github.com/repos/electron/electron/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/electron/electron/labels{/name}","releases_url":"https://api.github.com/repos/electron/electron/releases{/id}","deployments_url":"https://api.github.com/repos/electron/electron/deployments","created_at":"2013-04-12T01:47:36Z","updated_at":"2020-05-26T15:59:03Z","pushed_at":"2020-05-26T16:02:47Z","git_url":"git://github.com/electron/electron.git","ssh_url":"git@github.com:electron/electron.git","clone_url":"https://github.com/electron/electron.git","svn_url":"https://github.com/electron/electron","homepage":"https://electronjs.org","size":75428,"stargazers_count":82996,"watchers_count":82996,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":11129,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":1224,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":11129,"open_issues":1224,"watchers":82996,"default_branch":"master"}},"base":{"label":"electron:master","ref":"master","sha":"0979bfc9c1a3ad2d9a8d32eb63db6940d278ff02","user":{"login":"electron","id":13409222,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDA5MjIy","avatar_url":"https://avatars1.githubusercontent.com/u/13409222?v=4","gravatar_id":"","url":"https://api.github.com/users/electron","html_url":"https://github.com/electron","followers_url":"https://api.github.com/users/electron/followers","following_url":"https://api.github.com/users/electron/following{/other_user}","gists_url":"https://api.github.com/users/electron/gists{/gist_id}","starred_url":"https://api.github.com/users/electron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron/subscriptions","organizations_url":"https://api.github.com/users/electron/orgs","repos_url":"https://api.github.com/users/electron/repos","events_url":"https://api.github.com/users/electron/events{/privacy}","received_events_url":"https://api.github.com/users/electron/received_events","type":"Organization","site_admin":false},"repo":{"id":9384267,"node_id":"MDEwOlJlcG9zaXRvcnk5Mzg0MjY3","name":"electron","full_name":"electron/electron","private":false,"owner":{"login":"electron","id":13409222,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDA5MjIy","avatar_url":"https://avatars1.githubusercontent.com/u/13409222?v=4","gravatar_id":"","url":"https://api.github.com/users/electron","html_url":"https://github.com/electron","followers_url":"https://api.github.com/users/electron/followers","following_url":"https://api.github.com/users/electron/following{/other_user}","gists_url":"https://api.github.com/users/electron/gists{/gist_id}","starred_url":"https://api.github.com/users/electron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron/subscriptions","organizations_url":"https://api.github.com/users/electron/orgs","repos_url":"https://api.github.com/users/electron/repos","events_url":"https://api.github.com/users/electron/events{/privacy}","received_events_url":"https://api.github.com/users/electron/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/electron/electron","description":":electron: Build cross-platform desktop apps with JavaScript, HTML, and CSS","fork":false,"url":"https://api.github.com/repos/electron/electron","forks_url":"https://api.github.com/repos/electron/electron/forks","keys_url":"https://api.github.com/repos/electron/electron/keys{/key_id}","collaborators_url":"https://api.github.com/repos/electron/electron/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/electron/electron/teams","hooks_url":"https://api.github.com/repos/electron/electron/hooks","issue_events_url":"https://api.github.com/repos/electron/electron/issues/events{/number}","events_url":"https://api.github.com/repos/electron/electron/events","assignees_url":"https://api.github.com/repos/electron/electron/assignees{/user}","branches_url":"https://api.github.com/repos/electron/electron/branches{/branch}","tags_url":"https://api.github.com/repos/electron/electron/tags","blobs_url":"https://api.github.com/repos/electron/electron/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/electron/electron/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/electron/electron/git/refs{/sha}","trees_url":"https://api.github.com/repos/electron/electron/git/trees{/sha}","statuses_url":"https://api.github.com/repos/electron/electron/statuses/{sha}","languages_url":"https://api.github.com/repos/electron/electron/languages","stargazers_url":"https://api.github.com/repos/electron/electron/stargazers","contributors_url":"https://api.github.com/repos/electron/electron/contributors","subscribers_url":"https://api.github.com/repos/electron/electron/subscribers","subscription_url":"https://api.github.com/repos/electron/electron/subscription","commits_url":"https://api.github.com/repos/electron/electron/commits{/sha}","git_commits_url":"https://api.github.com/repos/electron/electron/git/commits{/sha}","comments_url":"https://api.github.com/repos/electron/electron/comments{/number}","issue_comment_url":"https://api.github.com/repos/electron/electron/issues/comments{/number}","contents_url":"https://api.github.com/repos/electron/electron/contents/{+path}","compare_url":"https://api.github.com/repos/electron/electron/compare/{base}...{head}","merges_url":"https://api.github.com/repos/electron/electron/merges","archive_url":"https://api.github.com/repos/electron/electron/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/electron/electron/downloads","issues_url":"https://api.github.com/repos/electron/electron/issues{/number}","pulls_url":"https://api.github.com/repos/electron/electron/pulls{/number}","milestones_url":"https://api.github.com/repos/electron/electron/milestones{/number}","notifications_url":"https://api.github.com/repos/electron/electron/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/electron/electron/labels{/name}","releases_url":"https://api.github.com/repos/electron/electron/releases{/id}","deployments_url":"https://api.github.com/repos/electron/electron/deployments","created_at":"2013-04-12T01:47:36Z","updated_at":"2020-05-26T15:59:03Z","pushed_at":"2020-05-26T16:02:47Z","git_url":"git://github.com/electron/electron.git","ssh_url":"git@github.com:electron/electron.git","clone_url":"https://github.com/electron/electron.git","svn_url":"https://github.com/electron/electron","homepage":"https://electronjs.org","size":75428,"stargazers_count":82996,"watchers_count":82996,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":11129,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":1224,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":11129,"open_issues":1224,"watchers":82996,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/electron/electron/pulls/21946"},"html":{"href":"https://github.com/electron/electron/pull/21946"},"issue":{"href":"https://api.github.com/repos/electron/electron/issues/21946"},"comments":{"href":"https://api.github.com/repos/electron/electron/issues/21946/comments"},"review_comments":{"href":"https://api.github.com/repos/electron/electron/pulls/21946/comments"},"review_comment":{"href":"https://api.github.com/repos/electron/electron/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/electron/electron/pulls/21946/commits"},"statuses":{"href":"https://api.github.com/repos/electron/electron/statuses/858dbc690b159ecf767e6ae55e476f73ead931f6"}},"author_association":"MEMBER"}} |