{"action":"created","issue":{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-config/issues/234","labels_url":"https://api.github.com/repos/spring-cloud/spring-cloud-config/issues/234/labels{/name}","comments_url":"https://api.github.com/repos/spring-cloud/spring-cloud-config/issues/234/comments","events_url":"https://api.github.com/repos/spring-cloud/spring-cloud-config/issues/234/events","html_url":"https://github.com/spring-cloud/spring-cloud-config/issues/234","id":107607477,"number":234,"title":"Generic HTTP Client Pulling with HTTP Conditional Requests on GitHub API","user":{"login":"marcellodesales","id":131457,"avatar_url":"https://avatars.githubusercontent.com/u/131457?v=3","gravatar_id":"","url":"https://api.github.com/users/marcellodesales","html_url":"https://github.com/marcellodesales","followers_url":"https://api.github.com/users/marcellodesales/followers","following_url":"https://api.github.com/users/marcellodesales/following{/other_user}","gists_url":"https://api.github.com/users/marcellodesales/gists{/gist_id}","starred_url":"https://api.github.com/users/marcellodesales/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcellodesales/subscriptions","organizations_url":"https://api.github.com/users/marcellodesales/orgs","repos_url":"https://api.github.com/users/marcellodesales/repos","events_url":"https://api.github.com/users/marcellodesales/events{/privacy}","received_events_url":"https://api.github.com/users/marcellodesales/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-config/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-09-21T22:00:07Z","updated_at":"2015-09-21T22:48:22Z","closed_at":null,"body":"Hi there,\r\n\r\nProblem\r\n------\r\n\r\nHi guys,\r\n\r\nI was trying to build the Node.js Client with pulling capabilities against out GitHub server. According to https://developer.github.com/guides/getting-started/#conditional-requests, we can control content caching by using the `ETag` header value from contents. \r\n\r\nQuestion\r\n------- \r\n\r\nHow does the SpringCloud-Config clients make requests to GitHub Enterprise? Do you guys use this feature to identify when a resource has changed? Do you use the `ETag` and/or the `Last-Modified` HTTP Response Headers values??? \r\n\r\nOnline API works\r\n-----\r\n\r\nHere's the example of calling the API online with the proper 304 response.\r\n\r\nFirst Request\r\n----\r\n\r\nI can see the \r\n\r\n```js\r\nmdesales@Marcello-New2015 [09/19/2015 8:18:52] ~ $ \r\ncurl -i https://api.github.com/users/marcellodesales\r\n\r\nHTTP/1.1 200 OK\r\nServer: GitHub.com\r\nDate: Mon, 21 Sep 2015 21:57:41 GMT\r\nContent-Type: application/json; charset=utf-8\r\nContent-Length: 1393\r\nStatus: 200 OK\r\nX-RateLimit-Limit: 60\r\nX-RateLimit-Remaining: 56\r\nX-RateLimit-Reset: 1442875150\r\nCache-Control: public, max-age=60, s-maxage=60\r\nLast-Modified: Thu, 17 Sep 2015 22:23:50 GMT\r\nETag: \"36be0c1305782b56086b419619d90a4f\"\r\nVary: Accept\r\nX-GitHub-Media-Type: github.v3\r\nX-XSS-Protection: 1; mode=block\r\nX-Frame-Options: deny\r\nContent-Security-Policy: default-src 'none'\r\nAccess-Control-Allow-Credentials: true\r\nAccess-Control-Expose-Headers: ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval\r\nAccess-Control-Allow-Origin: *\r\nX-GitHub-Request-Id: C7108C1B:C026:C47BCD3:56007D55\r\nStrict-Transport-Security: max-age=31536000; includeSubdomains; preload\r\nX-Content-Type-Options: nosniff\r\nVary: Accept-Encoding\r\nX-Served-By: 8dd185e423974a7e13abbbe6e060031e\r\n\r\n{\r\n  \"login\": \"marcellodesales\",\r\n  \"id\": 131457,\r\n  \"avatar_url\": \"https://avatars.githubusercontent.com/u/131457?v=3\",\r\n  \"gravatar_id\": \"\",\r\n  \"url\": \"https://api.github.com/users/marcellodesales\",\r\n  \"html_url\": \"https://github.com/marcellodesales\",\r\n  \"followers_url\": \"https://api.github.com/users/marcellodesales/followers\",\r\n  \"following_url\": \"https://api.github.com/users/marcellodesales/following{/other_user}\",\r\n  \"gists_url\": \"https://api.github.com/users/marcellodesales/gists{/gist_id}\",\r\n  \"starred_url\": \"https://api.github.com/users/marcellodesales/starred{/owner}{/repo}\",\r\n  \"subscriptions_url\": \"https://api.github.com/users/marcellodesales/subscriptions\",\r\n  \"organizations_url\": \"https://api.github.com/users/marcellodesales/orgs\",\r\n  \"repos_url\": \"https://api.github.com/users/marcellodesales/repos\",\r\n  \"events_url\": \"https://api.github.com/users/marcellodesales/events{/privacy}\",\r\n  \"received_events_url\": \"https://api.github.com/users/marcellodesales/received_events\",\r\n  \"type\": \"User\",\r\n  \"site_admin\": false,\r\n  \"name\": \"Marcello de Sales\",\r\n  \"company\": \"Intuit\",\r\n  \"blog\": \"http://about.me/marcellodesales\",\r\n  \"location\": \"San Diego, CA\",\r\n  \"email\": \"marcello.desales@gmail.com\",\r\n  \"hireable\": null,\r\n  \"bio\": null,\r\n  \"public_repos\": 131,\r\n  \"public_gists\": 19,\r\n  \"followers\": 14,\r\n  \"following\": 20,\r\n  \"created_at\": \"2009-09-26T00:38:09Z\",\r\n  \"updated_at\": \"2015-09-17T22:23:50Z\"\r\n}\r\n```\r\n\r\nSecond Request\r\n------\r\n\r\nNote that the ETag value did not change.\r\n\r\n```js\r\n$ curl -i https://api.github.com/users/marcellodesales\r\nHTTP/1.1 200 OK\r\nServer: GitHub.com\r\nDate: Mon, 21 Sep 2015 21:58:19 GMT\r\nContent-Type: application/json; charset=utf-8\r\nContent-Length: 1393\r\nStatus: 200 OK\r\nX-RateLimit-Limit: 60\r\nX-RateLimit-Remaining: 55\r\nX-RateLimit-Reset: 1442875150\r\nCache-Control: public, max-age=60, s-maxage=60\r\nLast-Modified: Thu, 17 Sep 2015 22:23:50 GMT\r\nETag: \"36be0c1305782b56086b419619d90a4f\"\r\nVary: Accept\r\nX-GitHub-Media-Type: github.v3\r\nX-XSS-Protection: 1; mode=block\r\nX-Frame-Options: deny\r\nContent-Security-Policy: default-src 'none'\r\nAccess-Control-Allow-Credentials: true\r\nAccess-Control-Expose-Headers: ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval\r\nAccess-Control-Allow-Origin: *\r\nX-GitHub-Request-Id: C7108C1B:ED5F:C538C71:56007D7B\r\nStrict-Transport-Security: max-age=31536000; includeSubdomains; preload\r\nX-Content-Type-Options: nosniff\r\nVary: Accept-Encoding\r\nX-Served-By: 07ff1c8a09e44b62e277fae50a1b1dc4\r\n\r\n{\r\n  \"login\": \"marcellodesales\",\r\n  \"id\": 131457,\r\n  \"avatar_url\": \"https://avatars.githubusercontent.com/u/131457?v=3\",\r\n  \"gravatar_id\": \"\",\r\n  \"url\": \"https://api.github.com/users/marcellodesales\",\r\n  \"html_url\": \"https://github.com/marcellodesales\",\r\n  \"followers_url\": \"https://api.github.com/users/marcellodesales/followers\",\r\n  \"following_url\": \"https://api.github.com/users/marcellodesales/following{/other_user}\",\r\n  \"gists_url\": \"https://api.github.com/users/marcellodesales/gists{/gist_id}\",\r\n  \"starred_url\": \"https://api.github.com/users/marcellodesales/starred{/owner}{/repo}\",\r\n  \"subscriptions_url\": \"https://api.github.com/users/marcellodesales/subscriptions\",\r\n  \"organizations_url\": \"https://api.github.com/users/marcellodesales/orgs\",\r\n  \"repos_url\": \"https://api.github.com/users/marcellodesales/repos\",\r\n  \"events_url\": \"https://api.github.com/users/marcellodesales/events{/privacy}\",\r\n  \"received_events_url\": \"https://api.github.com/users/marcellodesales/received_events\",\r\n  \"type\": \"User\",\r\n  \"site_admin\": false,\r\n  \"name\": \"Marcello de Sales\",\r\n  \"company\": \"Intuit\",\r\n  \"blog\": \"http://about.me/marcellodesales\",\r\n  \"location\": \"San Diego, CA\",\r\n  \"email\": \"marcello.desales@gmail.com\",\r\n  \"hireable\": null,\r\n  \"bio\": null,\r\n  \"public_repos\": 131,\r\n  \"public_gists\": 19,\r\n  \"followers\": 14,\r\n  \"following\": 20,\r\n  \"created_at\": \"2009-09-26T00:38:09Z\",\r\n  \"updated_at\": \"2015-09-17T22:23:50Z\"\r\n}\r\n```\r\n\r\nThird Request\r\n-------\r\n\r\nUsing \"If-None-Match\" value. It returned 304 as expected.\r\n\r\n```js\r\nmdesales@Marcello-New2015 [09/19/2015 8:19:48] ~ $ \r\n$ curl -i -H 'If-None-Match: \"36be0c1305782b56086b419619d90a4f\"' https://api.github.com/users/marcellodesales\r\n\r\nHTTP/1.1 304 Not Modified\r\nServer: GitHub.com\r\nDate: Mon, 21 Sep 2015 21:59:38 GMT\r\nStatus: 304 Not Modified\r\nX-RateLimit-Limit: 60\r\nX-RateLimit-Remaining: 55\r\nX-RateLimit-Reset: 1442875150\r\nCache-Control: public, max-age=60, s-maxage=60\r\nLast-Modified: Thu, 17 Sep 2015 22:23:50 GMT\r\nETag: \"36be0c1305782b56086b419619d90a4f\"\r\nX-XSS-Protection: 1; mode=block\r\nX-Frame-Options: deny\r\nContent-Security-Policy: default-src 'none'\r\nAccess-Control-Allow-Credentials: true\r\nAccess-Control-Expose-Headers: ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval\r\nAccess-Control-Allow-Origin: *\r\nX-GitHub-Request-Id: C7108C1B:19B11:AB55AE4:56007DCA\r\nStrict-Transport-Security: max-age=31536000; includeSubdomains; preload\r\nX-Content-Type-Options: nosniff\r\nVary: Accept-Encoding\r\nX-Served-By: b0ef53392caa42315c6206737946d931\r\n```\r\n\r\nThanks for any help\r\nMarcello"},"comment":{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-config/issues/comments/142130608","html_url":"https://github.com/spring-cloud/spring-cloud-config/issues/234#issuecomment-142130608","issue_url":"https://api.github.com/repos/spring-cloud/spring-cloud-config/issues/234","id":142130608,"user":{"login":"spencergibb","id":594085,"avatar_url":"https://avatars.githubusercontent.com/u/594085?v=3","gravatar_id":"","url":"https://api.github.com/users/spencergibb","html_url":"https://github.com/spencergibb","followers_url":"https://api.github.com/users/spencergibb/followers","following_url":"https://api.github.com/users/spencergibb/following{/other_user}","gists_url":"https://api.github.com/users/spencergibb/gists{/gist_id}","starred_url":"https://api.github.com/users/spencergibb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spencergibb/subscriptions","organizations_url":"https://api.github.com/users/spencergibb/orgs","repos_url":"https://api.github.com/users/spencergibb/repos","events_url":"https://api.github.com/users/spencergibb/events{/privacy}","received_events_url":"https://api.github.com/users/spencergibb/received_events","type":"User","site_admin":false},"created_at":"2015-09-21T22:48:22Z","updated_at":"2015-09-21T22:48:22Z","body":"Like I said, we need to be compatible with git, _not_ github. We already have an open issue about pushing notifications to clients #86."}}