{"action":"created","comment":{"url":"https://api.github.com/repos/opnsense/core/pulls/comments/224867319","pull_request_review_id":164346553,"id":224867319,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNDg2NzMxOQ==","diff_hunk":"@@ -4,24 +4,20 @@\n */\n function FindProxyForURL(url, host) {\n {% if helpers.exists('OPNsense.proxy.pac.rule') %}\n-{# define only if needed as because of performance issues #}\n-{% set dl = '' %}\n-{% set dstip = '' %}\n-{% set is_resolvable = '' %}\n-{% for match in helpers.toList('OPNsense.Proxy.pac.match') %}\n-{%   if match.match_type == 'dns_domain_levels' %}\n-{%     set dl = 'var dl =  dnsDomainLevels(host);' %}\n+{# define only if needed because of performance issues #}\n+{% set data = [] %}\n+{% for match in helpers.toList('OPNsense.proxy.pac.match') %}\n+{%   if 'var dl =  dnsDomainLevels(host);' not in data and match.match_type == 'dns_domain_levels' %}","path":"src/opnsense/service/templates/OPNsense/Proxy/wpad.dat","position":14,"original_position":14,"commit_id":"437d7fdc97d1706ae8aa421e1beebd93ad31ee6f","original_commit_id":"437d7fdc97d1706ae8aa421e1beebd93ad31ee6f","user":{"login":"fabianfrz","id":3713914,"node_id":"MDQ6VXNlcjM3MTM5MTQ=","avatar_url":"https://avatars1.githubusercontent.com/u/3713914?v=4","gravatar_id":"","url":"https://api.github.com/users/fabianfrz","html_url":"https://github.com/fabianfrz","followers_url":"https://api.github.com/users/fabianfrz/followers","following_url":"https://api.github.com/users/fabianfrz/following{/other_user}","gists_url":"https://api.github.com/users/fabianfrz/gists{/gist_id}","starred_url":"https://api.github.com/users/fabianfrz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabianfrz/subscriptions","organizations_url":"https://api.github.com/users/fabianfrz/orgs","repos_url":"https://api.github.com/users/fabianfrz/repos","events_url":"https://api.github.com/users/fabianfrz/events{/privacy}","received_events_url":"https://api.github.com/users/fabianfrz/received_events","type":"User","site_admin":false},"body":"@AdSchellevis this is no model data, but code that may cause performance issues and for that reason it is here to be so the result is cached between different matches. It should:\r\n\r\n1. executed only once\r\n2. added only when needed\r\n\r\nIn the final script this will render to 0-3 variable assignments.\r\n","created_at":"2018-10-12T17:51:34Z","updated_at":"2018-10-12T17:51:34Z","html_url":"https://github.com/opnsense/core/pull/2806#discussion_r224867319","pull_request_url":"https://api.github.com/repos/opnsense/core/pulls/2806","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/opnsense/core/pulls/comments/224867319"},"html":{"href":"https://github.com/opnsense/core/pull/2806#discussion_r224867319"},"pull_request":{"href":"https://api.github.com/repos/opnsense/core/pulls/2806"}},"in_reply_to_id":224692754},"pull_request":{"url":"https://api.github.com/repos/opnsense/core/pulls/2806","id":221925052,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIxOTI1MDUy","html_url":"https://github.com/opnsense/core/pull/2806","diff_url":"https://github.com/opnsense/core/pull/2806.diff","patch_url":"https://github.com/opnsense/core/pull/2806.patch","issue_url":"https://api.github.com/repos/opnsense/core/issues/2806","number":2806,"state":"open","locked":false,"title":"www/squid: fix pac template","user":{"login":"fabianfrz","id":3713914,"node_id":"MDQ6VXNlcjM3MTM5MTQ=","avatar_url":"https://avatars1.githubusercontent.com/u/3713914?v=4","gravatar_id":"","url":"https://api.github.com/users/fabianfrz","html_url":"https://github.com/fabianfrz","followers_url":"https://api.github.com/users/fabianfrz/followers","following_url":"https://api.github.com/users/fabianfrz/following{/other_user}","gists_url":"https://api.github.com/users/fabianfrz/gists{/gist_id}","starred_url":"https://api.github.com/users/fabianfrz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabianfrz/subscriptions","organizations_url":"https://api.github.com/users/fabianfrz/orgs","repos_url":"https://api.github.com/users/fabianfrz/repos","events_url":"https://api.github.com/users/fabianfrz/events{/privacy}","received_events_url":"https://api.github.com/users/fabianfrz/received_events","type":"User","site_admin":false},"body":"* jinja cannot update variables -> workaround via an hash\r\n* typo up/downcase\r\n* dependency missing for match","created_at":"2018-10-10T20:37:35Z","updated_at":"2018-10-12T17:51:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5127beeb4bb66cb5b8d6cc738de486a326ab5667","assignee":{"login":"AdSchellevis","id":9783985,"node_id":"MDQ6VXNlcjk3ODM5ODU=","avatar_url":"https://avatars2.githubusercontent.com/u/9783985?v=4","gravatar_id":"","url":"https://api.github.com/users/AdSchellevis","html_url":"https://github.com/AdSchellevis","followers_url":"https://api.github.com/users/AdSchellevis/followers","following_url":"https://api.github.com/users/AdSchellevis/following{/other_user}","gists_url":"https://api.github.com/users/AdSchellevis/gists{/gist_id}","starred_url":"https://api.github.com/users/AdSchellevis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AdSchellevis/subscriptions","organizations_url":"https://api.github.com/users/AdSchellevis/orgs","repos_url":"https://api.github.com/users/AdSchellevis/repos","events_url":"https://api.github.com/users/AdSchellevis/events{/privacy}","received_events_url":"https://api.github.com/users/AdSchellevis/received_events","type":"User","site_admin":false},"assignees":[{"login":"AdSchellevis","id":9783985,"node_id":"MDQ6VXNlcjk3ODM5ODU=","avatar_url":"https://avatars2.githubusercontent.com/u/9783985?v=4","gravatar_id":"","url":"https://api.github.com/users/AdSchellevis","html_url":"https://github.com/AdSchellevis","followers_url":"https://api.github.com/users/AdSchellevis/followers","following_url":"https://api.github.com/users/AdSchellevis/following{/other_user}","gists_url":"https://api.github.com/users/AdSchellevis/gists{/gist_id}","starred_url":"https://api.github.com/users/AdSchellevis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AdSchellevis/subscriptions","organizations_url":"https://api.github.com/users/AdSchellevis/orgs","repos_url":"https://api.github.com/users/AdSchellevis/repos","events_url":"https://api.github.com/users/AdSchellevis/events{/privacy}","received_events_url":"https://api.github.com/users/AdSchellevis/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/opnsense/core/pulls/2806/commits","review_comments_url":"https://api.github.com/repos/opnsense/core/pulls/2806/comments","review_comment_url":"https://api.github.com/repos/opnsense/core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/opnsense/core/issues/2806/comments","statuses_url":"https://api.github.com/repos/opnsense/core/statuses/437d7fdc97d1706ae8aa421e1beebd93ad31ee6f","head":{"label":"fabianfrz:pac_template_fix","ref":"pac_template_fix","sha":"437d7fdc97d1706ae8aa421e1beebd93ad31ee6f","user":{"login":"fabianfrz","id":3713914,"node_id":"MDQ6VXNlcjM3MTM5MTQ=","avatar_url":"https://avatars1.githubusercontent.com/u/3713914?v=4","gravatar_id":"","url":"https://api.github.com/users/fabianfrz","html_url":"https://github.com/fabianfrz","followers_url":"https://api.github.com/users/fabianfrz/followers","following_url":"https://api.github.com/users/fabianfrz/following{/other_user}","gists_url":"https://api.github.com/users/fabianfrz/gists{/gist_id}","starred_url":"https://api.github.com/users/fabianfrz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabianfrz/subscriptions","organizations_url":"https://api.github.com/users/fabianfrz/orgs","repos_url":"https://api.github.com/users/fabianfrz/repos","events_url":"https://api.github.com/users/fabianfrz/events{/privacy}","received_events_url":"https://api.github.com/users/fabianfrz/received_events","type":"User","site_admin":false},"repo":{"id":38628906,"node_id":"MDEwOlJlcG9zaXRvcnkzODYyODkwNg==","name":"core","full_name":"fabianfrz/core","private":false,"owner":{"login":"fabianfrz","id":3713914,"node_id":"MDQ6VXNlcjM3MTM5MTQ=","avatar_url":"https://avatars1.githubusercontent.com/u/3713914?v=4","gravatar_id":"","url":"https://api.github.com/users/fabianfrz","html_url":"https://github.com/fabianfrz","followers_url":"https://api.github.com/users/fabianfrz/followers","following_url":"https://api.github.com/users/fabianfrz/following{/other_user}","gists_url":"https://api.github.com/users/fabianfrz/gists{/gist_id}","starred_url":"https://api.github.com/users/fabianfrz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabianfrz/subscriptions","organizations_url":"https://api.github.com/users/fabianfrz/orgs","repos_url":"https://api.github.com/users/fabianfrz/repos","events_url":"https://api.github.com/users/fabianfrz/events{/privacy}","received_events_url":"https://api.github.com/users/fabianfrz/received_events","type":"User","site_admin":false},"html_url":"https://github.com/fabianfrz/core","description":"OPNsense GUI, API and systems backend","fork":true,"url":"https://api.github.com/repos/fabianfrz/core","forks_url":"https://api.github.com/repos/fabianfrz/core/forks","keys_url":"https://api.github.com/repos/fabianfrz/core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fabianfrz/core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fabianfrz/core/teams","hooks_url":"https://api.github.com/repos/fabianfrz/core/hooks","issue_events_url":"https://api.github.com/repos/fabianfrz/core/issues/events{/number}","events_url":"https://api.github.com/repos/fabianfrz/core/events","assignees_url":"https://api.github.com/repos/fabianfrz/core/assignees{/user}","branches_url":"https://api.github.com/repos/fabianfrz/core/branches{/branch}","tags_url":"https://api.github.com/repos/fabianfrz/core/tags","blobs_url":"https://api.github.com/repos/fabianfrz/core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fabianfrz/core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fabianfrz/core/git/refs{/sha}","trees_url":"https://api.github.com/repos/fabianfrz/core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fabianfrz/core/statuses/{sha}","languages_url":"https://api.github.com/repos/fabianfrz/core/languages","stargazers_url":"https://api.github.com/repos/fabianfrz/core/stargazers","contributors_url":"https://api.github.com/repos/fabianfrz/core/contributors","subscribers_url":"https://api.github.com/repos/fabianfrz/core/subscribers","subscription_url":"https://api.github.com/repos/fabianfrz/core/subscription","commits_url":"https://api.github.com/repos/fabianfrz/core/commits{/sha}","git_commits_url":"https://api.github.com/repos/fabianfrz/core/git/commits{/sha}","comments_url":"https://api.github.com/repos/fabianfrz/core/comments{/number}","issue_comment_url":"https://api.github.com/repos/fabianfrz/core/issues/comments{/number}","contents_url":"https://api.github.com/repos/fabianfrz/core/contents/{+path}","compare_url":"https://api.github.com/repos/fabianfrz/core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fabianfrz/core/merges","archive_url":"https://api.github.com/repos/fabianfrz/core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fabianfrz/core/downloads","issues_url":"https://api.github.com/repos/fabianfrz/core/issues{/number}","pulls_url":"https://api.github.com/repos/fabianfrz/core/pulls{/number}","milestones_url":"https://api.github.com/repos/fabianfrz/core/milestones{/number}","notifications_url":"https://api.github.com/repos/fabianfrz/core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fabianfrz/core/labels{/name}","releases_url":"https://api.github.com/repos/fabianfrz/core/releases{/id}","deployments_url":"https://api.github.com/repos/fabianfrz/core/deployments","created_at":"2015-07-06T15:47:17Z","updated_at":"2018-09-02T08:13:10Z","pushed_at":"2018-10-11T17:12:32Z","git_url":"git://github.com/fabianfrz/core.git","ssh_url":"git@github.com:fabianfrz/core.git","clone_url":"https://github.com/fabianfrz/core.git","svn_url":"https://github.com/fabianfrz/core","homepage":"https://opnsense.org/","size":63052,"stargazers_count":2,"watchers_count":2,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"bsd-2-clause","name":"BSD 2-Clause \"Simplified\" License","spdx_id":"BSD-2-Clause","url":"https://api.github.com/licenses/bsd-2-clause","node_id":"MDc6TGljZW5zZTQ="},"forks":0,"open_issues":0,"watchers":2,"default_branch":"master"}},"base":{"label":"opnsense:master","ref":"master","sha":"b27a62b7f5f01702fb955cfef780aa4310d8ec88","user":{"login":"opnsense","id":9979117,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk5NzkxMTc=","avatar_url":"https://avatars3.githubusercontent.com/u/9979117?v=4","gravatar_id":"","url":"https://api.github.com/users/opnsense","html_url":"https://github.com/opnsense","followers_url":"https://api.github.com/users/opnsense/followers","following_url":"https://api.github.com/users/opnsense/following{/other_user}","gists_url":"https://api.github.com/users/opnsense/gists{/gist_id}","starred_url":"https://api.github.com/users/opnsense/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opnsense/subscriptions","organizations_url":"https://api.github.com/users/opnsense/orgs","repos_url":"https://api.github.com/users/opnsense/repos","events_url":"https://api.github.com/users/opnsense/events{/privacy}","received_events_url":"https://api.github.com/users/opnsense/received_events","type":"Organization","site_admin":false},"repo":{"id":27965134,"node_id":"MDEwOlJlcG9zaXRvcnkyNzk2NTEzNA==","name":"core","full_name":"opnsense/core","private":false,"owner":{"login":"opnsense","id":9979117,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk5NzkxMTc=","avatar_url":"https://avatars3.githubusercontent.com/u/9979117?v=4","gravatar_id":"","url":"https://api.github.com/users/opnsense","html_url":"https://github.com/opnsense","followers_url":"https://api.github.com/users/opnsense/followers","following_url":"https://api.github.com/users/opnsense/following{/other_user}","gists_url":"https://api.github.com/users/opnsense/gists{/gist_id}","starred_url":"https://api.github.com/users/opnsense/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opnsense/subscriptions","organizations_url":"https://api.github.com/users/opnsense/orgs","repos_url":"https://api.github.com/users/opnsense/repos","events_url":"https://api.github.com/users/opnsense/events{/privacy}","received_events_url":"https://api.github.com/users/opnsense/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/opnsense/core","description":"OPNsense GUI, API and systems backend","fork":false,"url":"https://api.github.com/repos/opnsense/core","forks_url":"https://api.github.com/repos/opnsense/core/forks","keys_url":"https://api.github.com/repos/opnsense/core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/opnsense/core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/opnsense/core/teams","hooks_url":"https://api.github.com/repos/opnsense/core/hooks","issue_events_url":"https://api.github.com/repos/opnsense/core/issues/events{/number}","events_url":"https://api.github.com/repos/opnsense/core/events","assignees_url":"https://api.github.com/repos/opnsense/core/assignees{/user}","branches_url":"https://api.github.com/repos/opnsense/core/branches{/branch}","tags_url":"https://api.github.com/repos/opnsense/core/tags","blobs_url":"https://api.github.com/repos/opnsense/core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/opnsense/core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/opnsense/core/git/refs{/sha}","trees_url":"https://api.github.com/repos/opnsense/core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/opnsense/core/statuses/{sha}","languages_url":"https://api.github.com/repos/opnsense/core/languages","stargazers_url":"https://api.github.com/repos/opnsense/core/stargazers","contributors_url":"https://api.github.com/repos/opnsense/core/contributors","subscribers_url":"https://api.github.com/repos/opnsense/core/subscribers","subscription_url":"https://api.github.com/repos/opnsense/core/subscription","commits_url":"https://api.github.com/repos/opnsense/core/commits{/sha}","git_commits_url":"https://api.github.com/repos/opnsense/core/git/commits{/sha}","comments_url":"https://api.github.com/repos/opnsense/core/comments{/number}","issue_comment_url":"https://api.github.com/repos/opnsense/core/issues/comments{/number}","contents_url":"https://api.github.com/repos/opnsense/core/contents/{+path}","compare_url":"https://api.github.com/repos/opnsense/core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/opnsense/core/merges","archive_url":"https://api.github.com/repos/opnsense/core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/opnsense/core/downloads","issues_url":"https://api.github.com/repos/opnsense/core/issues{/number}","pulls_url":"https://api.github.com/repos/opnsense/core/pulls{/number}","milestones_url":"https://api.github.com/repos/opnsense/core/milestones{/number}","notifications_url":"https://api.github.com/repos/opnsense/core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/opnsense/core/labels{/name}","releases_url":"https://api.github.com/repos/opnsense/core/releases{/id}","deployments_url":"https://api.github.com/repos/opnsense/core/deployments","created_at":"2014-12-13T15:43:50Z","updated_at":"2018-10-11T17:48:12Z","pushed_at":"2018-10-11T18:05:42Z","git_url":"git://github.com/opnsense/core.git","ssh_url":"git@github.com:opnsense/core.git","clone_url":"https://github.com/opnsense/core.git","svn_url":"https://github.com/opnsense/core","homepage":"https://opnsense.org/","size":63192,"stargazers_count":684,"watchers_count":684,"language":"PHP","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":234,"mirror_url":null,"archived":false,"open_issues_count":194,"license":{"key":"bsd-2-clause","name":"BSD 2-Clause \"Simplified\" License","spdx_id":"BSD-2-Clause","url":"https://api.github.com/licenses/bsd-2-clause","node_id":"MDc6TGljZW5zZTQ="},"forks":234,"open_issues":194,"watchers":684,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/opnsense/core/pulls/2806"},"html":{"href":"https://github.com/opnsense/core/pull/2806"},"issue":{"href":"https://api.github.com/repos/opnsense/core/issues/2806"},"comments":{"href":"https://api.github.com/repos/opnsense/core/issues/2806/comments"},"review_comments":{"href":"https://api.github.com/repos/opnsense/core/pulls/2806/comments"},"review_comment":{"href":"https://api.github.com/repos/opnsense/core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/opnsense/core/pulls/2806/commits"},"statuses":{"href":"https://api.github.com/repos/opnsense/core/statuses/437d7fdc97d1706ae8aa421e1beebd93ad31ee6f"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"fabianfrz"}}