Title: Use better default Accept-header for JDKHttpClient · Issue #1042 · scribejava/scribejava · GitHub
Open Graph Title: Use better default Accept-header for JDKHttpClient · Issue #1042 · scribejava/scribejava
X Title: Use better default Accept-header for JDKHttpClient · Issue #1042 · scribejava/scribejava
Description: Currently the JDKHttpClient uses the following Accept header, if none is specified by the calling code: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2 As described in a JDK issue [1], this causes problems with several server side l...
Open Graph Description: Currently the JDKHttpClient uses the following Accept header, if none is specified by the calling code: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2 As described in a JDK issue [1], this ca...
X Description: Currently the JDKHttpClient uses the following Accept header, if none is specified by the calling code: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2 As described in a JDK issue [1], this ca...
Opengraph URL: https://github.com/scribejava/scribejava/issues/1042
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Use better default Accept-header for JDKHttpClient","articleBody":"Currently the JDKHttpClient uses the following Accept header, if none is specified by the calling code: `text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2`\r\n\r\nAs described in a JDK issue [1], this causes problems with several server side libraries.\r\n\r\nI had problems to get the device authorization flow working with Keycloak due to this issue.\r\n\r\nWhat worked for me was extending OAuth20Service, and overriding the execute methods, and patching the request like that:\r\n`request.addHeader(\"Accept\", \"*/*\")`;\r\n\r\nThe accept header `*/*` is used per default by Postman and curl, so it seems to be a meaningful default - at least better than html, image and so on (afaik, scribejava is mostly dealing with JSON).\r\n\r\nI would suggest to change method `JDKHttpClient#prepareConnectionForBodyAndGetOutputStream` to set this meaningful default Accept header, if none has been already set. [2]\r\n\r\n[1] https://bugs.openjdk.org/browse/JDK-8163921\r\n[2] https://github.com/scribejava/scribejava/blob/49cf8a6f2a88b3c6398b6e7616bedc458f97c0e4/scribejava-core/src/main/java/com/github/scribejava/core/httpclient/jdk/JDKHttpClient.java#L224","author":{"url":"https://github.com/danielFesenmeyer","@type":"Person","name":"danielFesenmeyer"},"datePublished":"2022-06-30T16:31:32Z","url":"https://github.com/scribejava/scribejava/issues/1042"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:5eb47605-5da2-8026-92dc-a2f185d604cd |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DCAC:2A130F:B50812:100E015:6AFCB87A |
| html-safe-nonce | b0ce60815cd7ee2214c4304df7ff98fda7ab4c673382380a9fdc1bee6ca0000a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQ0FDOjJBMTMwRjpCNTA4MTI6MTAwRTAxNTo2QUZDQjg3QSIsInZpc2l0b3JfaWQiOiI0NzYzNjYyOTMxMTg1MTU0MTcwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | bc18639a2fe1dc54eabc660101e37d9e2c7623796fb5dc7c1650fb75c71f5246 |
| hovercard-subject-tag | issue:1290384602 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/scribejava/scribejava/1042/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1eda2ce3c7e89c6e495c41a25f98c6d9c2f1d6aa1441e59cb2e1f4aad2b3db22/scribejava/scribejava/issues/1042 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1eda2ce3c7e89c6e495c41a25f98c6d9c2f1d6aa1441e59cb2e1f4aad2b3db22/scribejava/scribejava/issues/1042 |
| og:image:alt | Currently the JDKHttpClient uses the following Accept header, if none is specified by the calling code: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2 As described in a JDK issue [1], this ca... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | danielFesenmeyer |
| hostname | github.com |
| expected-hostname | github.com |
| None | e3084aead77cbcb4f4904fba53851fa1a0546b0dec3619bd250815e72588dc6d |
| turbo-cache-control | no-preview |
| go-import | github.com/scribejava/scribejava git https://github.com/scribejava/scribejava.git |
| octolytics-dimension-user_id | 15140551 |
| octolytics-dimension-user_login | scribejava |
| octolytics-dimension-repository_id | 889932 |
| octolytics-dimension-repository_nwo | scribejava/scribejava |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 889932 |
| octolytics-dimension-repository_network_root_nwo | scribejava/scribejava |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 5410e4bebd3e45b138c853ecef3992279d86d5af |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width