{"action":"created","comment":{"url":"https://api.github.com/repos/mholt/caddy/pulls/comments/61154831","id":61154831,"diff_hunk":"@@ -95,6 +95,7 @@ func NewReplacer(r *http.Request, rr *ResponseRecorder, emptyValue string) Repla\n \t\t\t\tdir, _ := path.Split(r.URL.Path)\n \t\t\t\treturn dir\n \t\t\t}(),\n+\t\t\t\"{locale}\": r.Header.Get(\"Detected-Locale\"),","path":"middleware/replacer.go","position":4,"original_position":4,"commit_id":"a37c788a19889e98d1c5133d5d118993158c62d8","original_commit_id":"a37c788a19889e98d1c5133d5d118993158c62d8","user":{"login":"mholt","id":1128849,"avatar_url":"https://avatars.githubusercontent.com/u/1128849?v=3","gravatar_id":"","url":"https://api.github.com/users/mholt","html_url":"https://github.com/mholt","followers_url":"https://api.github.com/users/mholt/followers","following_url":"https://api.github.com/users/mholt/following{/other_user}","gists_url":"https://api.github.com/users/mholt/gists{/gist_id}","starred_url":"https://api.github.com/users/mholt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mholt/subscriptions","organizations_url":"https://api.github.com/users/mholt/orgs","repos_url":"https://api.github.com/users/mholt/repos","events_url":"https://api.github.com/users/mholt/events{/privacy}","received_events_url":"https://api.github.com/users/mholt/received_events","type":"User","site_admin":false},"body":"This can already be done with `{>Detected-Locale}`, why make another way to do it?","created_at":"2016-04-26T20:07:08Z","updated_at":"2016-04-26T20:07:08Z","html_url":"https://github.com/mholt/caddy/pull/781#discussion_r61154831","pull_request_url":"https://api.github.com/repos/mholt/caddy/pulls/781","_links":{"self":{"href":"https://api.github.com/repos/mholt/caddy/pulls/comments/61154831"},"html":{"href":"https://github.com/mholt/caddy/pull/781#discussion_r61154831"},"pull_request":{"href":"https://api.github.com/repos/mholt/caddy/pulls/781"}}},"pull_request":{"url":"https://api.github.com/repos/mholt/caddy/pulls/781","id":67495544,"html_url":"https://github.com/mholt/caddy/pull/781","diff_url":"https://github.com/mholt/caddy/pull/781.diff","patch_url":"https://github.com/mholt/caddy/pull/781.patch","issue_url":"https://api.github.com/repos/mholt/caddy/issues/781","number":781,"state":"open","locked":false,"title":"Locale detection","user":{"login":"phifty","id":213830,"avatar_url":"https://avatars.githubusercontent.com/u/213830?v=3","gravatar_id":"","url":"https://api.github.com/users/phifty","html_url":"https://github.com/phifty","followers_url":"https://api.github.com/users/phifty/followers","following_url":"https://api.github.com/users/phifty/following{/other_user}","gists_url":"https://api.github.com/users/phifty/gists{/gist_id}","starred_url":"https://api.github.com/users/phifty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phifty/subscriptions","organizations_url":"https://api.github.com/users/phifty/orgs","repos_url":"https://api.github.com/users/phifty/repos","events_url":"https://api.github.com/users/phifty/events{/privacy}","received_events_url":"https://api.github.com/users/phifty/received_events","type":"User","site_admin":false},"body":"It's a first version of a locale detection extension. The locale can be determined by cookie and request header (`Accept-Language`). The result is written to the `Detected-Locale` request header and can be accessed by the `{locale}` placeholder.\r\n\r\nThe tests are running and the `locale` seems to get parsed, but somehow the middleware does not seem to get called. I'm new to caddy, so maybe I'm missing something. A review would be welcome.","created_at":"2016-04-22T11:12:45Z","updated_at":"2016-04-26T20:07:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ce1d393b269cd7c3bca6450a09f1eb981c47dcdf","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mholt/caddy/pulls/781/commits","review_comments_url":"https://api.github.com/repos/mholt/caddy/pulls/781/comments","review_comment_url":"https://api.github.com/repos/mholt/caddy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mholt/caddy/issues/781/comments","statuses_url":"https://api.github.com/repos/mholt/caddy/statuses/a37c788a19889e98d1c5133d5d118993158c62d8","head":{"label":"simia-tech:master","ref":"master","sha":"a37c788a19889e98d1c5133d5d118993158c62d8","user":{"login":"simia-tech","id":5470652,"avatar_url":"https://avatars.githubusercontent.com/u/5470652?v=3","gravatar_id":"","url":"https://api.github.com/users/simia-tech","html_url":"https://github.com/simia-tech","followers_url":"https://api.github.com/users/simia-tech/followers","following_url":"https://api.github.com/users/simia-tech/following{/other_user}","gists_url":"https://api.github.com/users/simia-tech/gists{/gist_id}","starred_url":"https://api.github.com/users/simia-tech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simia-tech/subscriptions","organizations_url":"https://api.github.com/users/simia-tech/orgs","repos_url":"https://api.github.com/users/simia-tech/repos","events_url":"https://api.github.com/users/simia-tech/events{/privacy}","received_events_url":"https://api.github.com/users/simia-tech/received_events","type":"Organization","site_admin":false},"repo":{"id":56785382,"name":"caddy","full_name":"simia-tech/caddy","owner":{"login":"simia-tech","id":5470652,"avatar_url":"https://avatars.githubusercontent.com/u/5470652?v=3","gravatar_id":"","url":"https://api.github.com/users/simia-tech","html_url":"https://github.com/simia-tech","followers_url":"https://api.github.com/users/simia-tech/followers","following_url":"https://api.github.com/users/simia-tech/following{/other_user}","gists_url":"https://api.github.com/users/simia-tech/gists{/gist_id}","starred_url":"https://api.github.com/users/simia-tech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simia-tech/subscriptions","organizations_url":"https://api.github.com/users/simia-tech/orgs","repos_url":"https://api.github.com/users/simia-tech/repos","events_url":"https://api.github.com/users/simia-tech/events{/privacy}","received_events_url":"https://api.github.com/users/simia-tech/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/simia-tech/caddy","description":"Fast, cross-platform HTTP/2 web server with automatic HTTPS","fork":true,"url":"https://api.github.com/repos/simia-tech/caddy","forks_url":"https://api.github.com/repos/simia-tech/caddy/forks","keys_url":"https://api.github.com/repos/simia-tech/caddy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/simia-tech/caddy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/simia-tech/caddy/teams","hooks_url":"https://api.github.com/repos/simia-tech/caddy/hooks","issue_events_url":"https://api.github.com/repos/simia-tech/caddy/issues/events{/number}","events_url":"https://api.github.com/repos/simia-tech/caddy/events","assignees_url":"https://api.github.com/repos/simia-tech/caddy/assignees{/user}","branches_url":"https://api.github.com/repos/simia-tech/caddy/branches{/branch}","tags_url":"https://api.github.com/repos/simia-tech/caddy/tags","blobs_url":"https://api.github.com/repos/simia-tech/caddy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/simia-tech/caddy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/simia-tech/caddy/git/refs{/sha}","trees_url":"https://api.github.com/repos/simia-tech/caddy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/simia-tech/caddy/statuses/{sha}","languages_url":"https://api.github.com/repos/simia-tech/caddy/languages","stargazers_url":"https://api.github.com/repos/simia-tech/caddy/stargazers","contributors_url":"https://api.github.com/repos/simia-tech/caddy/contributors","subscribers_url":"https://api.github.com/repos/simia-tech/caddy/subscribers","subscription_url":"https://api.github.com/repos/simia-tech/caddy/subscription","commits_url":"https://api.github.com/repos/simia-tech/caddy/commits{/sha}","git_commits_url":"https://api.github.com/repos/simia-tech/caddy/git/commits{/sha}","comments_url":"https://api.github.com/repos/simia-tech/caddy/comments{/number}","issue_comment_url":"https://api.github.com/repos/simia-tech/caddy/issues/comments{/number}","contents_url":"https://api.github.com/repos/simia-tech/caddy/contents/{+path}","compare_url":"https://api.github.com/repos/simia-tech/caddy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/simia-tech/caddy/merges","archive_url":"https://api.github.com/repos/simia-tech/caddy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/simia-tech/caddy/downloads","issues_url":"https://api.github.com/repos/simia-tech/caddy/issues{/number}","pulls_url":"https://api.github.com/repos/simia-tech/caddy/pulls{/number}","milestones_url":"https://api.github.com/repos/simia-tech/caddy/milestones{/number}","notifications_url":"https://api.github.com/repos/simia-tech/caddy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/simia-tech/caddy/labels{/name}","releases_url":"https://api.github.com/repos/simia-tech/caddy/releases{/id}","deployments_url":"https://api.github.com/repos/simia-tech/caddy/deployments","created_at":"2016-04-21T15:31:13Z","updated_at":"2016-04-21T15:31:15Z","pushed_at":"2016-04-26T16:03:13Z","git_url":"git://github.com/simia-tech/caddy.git","ssh_url":"git@github.com:simia-tech/caddy.git","clone_url":"https://github.com/simia-tech/caddy.git","svn_url":"https://github.com/simia-tech/caddy","homepage":"https://caddyserver.com","size":1618,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mholt:master","ref":"master","sha":"21382702d2398590a1fde7d33baf975003b964c0","user":{"login":"mholt","id":1128849,"avatar_url":"https://avatars.githubusercontent.com/u/1128849?v=3","gravatar_id":"","url":"https://api.github.com/users/mholt","html_url":"https://github.com/mholt","followers_url":"https://api.github.com/users/mholt/followers","following_url":"https://api.github.com/users/mholt/following{/other_user}","gists_url":"https://api.github.com/users/mholt/gists{/gist_id}","starred_url":"https://api.github.com/users/mholt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mholt/subscriptions","organizations_url":"https://api.github.com/users/mholt/orgs","repos_url":"https://api.github.com/users/mholt/repos","events_url":"https://api.github.com/users/mholt/events{/privacy}","received_events_url":"https://api.github.com/users/mholt/received_events","type":"User","site_admin":false},"repo":{"id":29207621,"name":"caddy","full_name":"mholt/caddy","owner":{"login":"mholt","id":1128849,"avatar_url":"https://avatars.githubusercontent.com/u/1128849?v=3","gravatar_id":"","url":"https://api.github.com/users/mholt","html_url":"https://github.com/mholt","followers_url":"https://api.github.com/users/mholt/followers","following_url":"https://api.github.com/users/mholt/following{/other_user}","gists_url":"https://api.github.com/users/mholt/gists{/gist_id}","starred_url":"https://api.github.com/users/mholt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mholt/subscriptions","organizations_url":"https://api.github.com/users/mholt/orgs","repos_url":"https://api.github.com/users/mholt/repos","events_url":"https://api.github.com/users/mholt/events{/privacy}","received_events_url":"https://api.github.com/users/mholt/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mholt/caddy","description":"Fast, cross-platform HTTP/2 web server with automatic HTTPS","fork":false,"url":"https://api.github.com/repos/mholt/caddy","forks_url":"https://api.github.com/repos/mholt/caddy/forks","keys_url":"https://api.github.com/repos/mholt/caddy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mholt/caddy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mholt/caddy/teams","hooks_url":"https://api.github.com/repos/mholt/caddy/hooks","issue_events_url":"https://api.github.com/repos/mholt/caddy/issues/events{/number}","events_url":"https://api.github.com/repos/mholt/caddy/events","assignees_url":"https://api.github.com/repos/mholt/caddy/assignees{/user}","branches_url":"https://api.github.com/repos/mholt/caddy/branches{/branch}","tags_url":"https://api.github.com/repos/mholt/caddy/tags","blobs_url":"https://api.github.com/repos/mholt/caddy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mholt/caddy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mholt/caddy/git/refs{/sha}","trees_url":"https://api.github.com/repos/mholt/caddy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mholt/caddy/statuses/{sha}","languages_url":"https://api.github.com/repos/mholt/caddy/languages","stargazers_url":"https://api.github.com/repos/mholt/caddy/stargazers","contributors_url":"https://api.github.com/repos/mholt/caddy/contributors","subscribers_url":"https://api.github.com/repos/mholt/caddy/subscribers","subscription_url":"https://api.github.com/repos/mholt/caddy/subscription","commits_url":"https://api.github.com/repos/mholt/caddy/commits{/sha}","git_commits_url":"https://api.github.com/repos/mholt/caddy/git/commits{/sha}","comments_url":"https://api.github.com/repos/mholt/caddy/comments{/number}","issue_comment_url":"https://api.github.com/repos/mholt/caddy/issues/comments{/number}","contents_url":"https://api.github.com/repos/mholt/caddy/contents/{+path}","compare_url":"https://api.github.com/repos/mholt/caddy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mholt/caddy/merges","archive_url":"https://api.github.com/repos/mholt/caddy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mholt/caddy/downloads","issues_url":"https://api.github.com/repos/mholt/caddy/issues{/number}","pulls_url":"https://api.github.com/repos/mholt/caddy/pulls{/number}","milestones_url":"https://api.github.com/repos/mholt/caddy/milestones{/number}","notifications_url":"https://api.github.com/repos/mholt/caddy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mholt/caddy/labels{/name}","releases_url":"https://api.github.com/repos/mholt/caddy/releases{/id}","deployments_url":"https://api.github.com/repos/mholt/caddy/deployments","created_at":"2015-01-13T19:45:03Z","updated_at":"2016-04-26T16:38:57Z","pushed_at":"2016-04-26T16:03:13Z","git_url":"git://github.com/mholt/caddy.git","ssh_url":"git@github.com:mholt/caddy.git","clone_url":"https://github.com/mholt/caddy.git","svn_url":"https://github.com/mholt/caddy","homepage":"https://caddyserver.com","size":2394,"stargazers_count":5623,"watchers_count":5623,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":367,"mirror_url":null,"open_issues_count":72,"forks":367,"open_issues":72,"watchers":5623,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mholt/caddy/pulls/781"},"html":{"href":"https://github.com/mholt/caddy/pull/781"},"issue":{"href":"https://api.github.com/repos/mholt/caddy/issues/781"},"comments":{"href":"https://api.github.com/repos/mholt/caddy/issues/781/comments"},"review_comments":{"href":"https://api.github.com/repos/mholt/caddy/pulls/781/comments"},"review_comment":{"href":"https://api.github.com/repos/mholt/caddy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mholt/caddy/pulls/781/commits"},"statuses":{"href":"https://api.github.com/repos/mholt/caddy/statuses/a37c788a19889e98d1c5133d5d118993158c62d8"}}}}