René's URL Explorer Experiment


Title: Allow for an unknown content length. by twalmsley · Pull Request #127 · dnsjava/dnsjava · GitHub

Open Graph Title: Allow for an unknown content length. by twalmsley · Pull Request #127 · dnsjava/dnsjava

X Title: Allow for an unknown content length. by twalmsley · Pull Request #127 · dnsjava/dnsjava

Description: My DoH service works fine when accessed directly, but when it is behind an API gateway the response content length is unknown, so conn.getContentLength() returns -1 which causes an exception to be thrown. I have 2 suggested changes here: When the content length is unknown, just create a fixed size buffer for the response. I have chosen a maximum size that seems sensible to me, and I know I could have made it dynamic, but I think even in that case there would still be a need for a sensible maximum buffer size. I can change this if needed. When reading from the connection stream, it is always trying to read responseBytes.length bytes, but if it has already read some bytes then there will be no room for that number of bytes, so I have used the offset to reduce this as bytes are read into the buffer. I realise that if the content length is known then it won't read more than the expected number of bytes, but in the case when the length is not known it will be possible to read more bytes than the allocated buffer size, hence the check. I have tested this against https://dns.google/dns-query which does return a valid content length, as well as my own service behind an API gateway which returns -1 for the content length, and it succeeds in both cases.

Open Graph Description: My DoH service works fine when accessed directly, but when it is behind an API gateway the response content length is unknown, so conn.getContentLength() returns -1 which causes an exception to be ...

X Description: My DoH service works fine when accessed directly, but when it is behind an API gateway the response content length is unknown, so conn.getContentLength() returns -1 which causes an exception to be ...

Opengraph URL: https://github.com/dnsjava/dnsjava/pull/127

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.4

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:84f9d472-1752-7715-5013-9835d5c96897
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idCA8E:17B76C:10F2431:1676A47:6B06549E
html-safe-nonce86a9702203feffa4b47603b5baf53775e2d09b137652f0caf188e8e364fa60db
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQThFOjE3Qjc2QzoxMEYyNDMxOjE2NzZBNDc6NkIwNjU0OUUiLCJ2aXNpdG9yX2lkIjoiMzU3NjEwNjQ4Mjg2NjgwMjIyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac7d210bc75233295be890fab5fd3bbf4080fb8e6449ca12f5076e2eff06b3ff58
hovercard-subject-tagpull_request:482060112
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/dnsjava/dnsjava/pull/127/files
twitter:imagehttps://avatars.githubusercontent.com/u/2378576?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/2378576?s=400&v=4
og:image:altMy DoH service works fine when accessed directly, but when it is behind an API gateway the response content length is unknown, so conn.getContentLength() returns -1 which causes an exception to be ...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None6324e6ac990fb6befbec840cc0e102a1071c339bfe8f9826bb12de2e3ba1d297
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/dnsjava/dnsjava git https://github.com/dnsjava/dnsjava.git
octolytics-dimension-user_id6755615
octolytics-dimension-user_logindnsjava
octolytics-dimension-repository_id17084567
octolytics-dimension-repository_nwodnsjava/dnsjava
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id17084567
octolytics-dimension-repository_network_root_nwodnsjava/dnsjava
turbo-body-classeslogged-out env-production page-responsive
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release7f0aa75f4141d440c6110dc31af7ea7797abb6c4
ui-targetcanary-1
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/dnsjava/dnsjava/pull/127/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fdnsjava%2Fdnsjava%2Fpull%2F127%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fdnsjava%2Fdnsjava%2Fpull%2F127%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=dnsjava%2Fdnsjava
Reloadhttps://github.com/dnsjava/dnsjava/pull/127/files
Reloadhttps://github.com/dnsjava/dnsjava/pull/127/files
Reloadhttps://github.com/dnsjava/dnsjava/pull/127/files
dnsjavahttps://github.com/dnsjava
dnsjavahttps://github.com/dnsjava/dnsjava
Codehttps://github.com/dnsjava/dnsjava
Issues16 (16)https://github.com/dnsjava/dnsjava/issues
Pull requests3 (3)https://github.com/dnsjava/dnsjava/pulls
Actionshttps://github.com/dnsjava/dnsjava/actions
Security and quality8 (8)https://github.com/dnsjava/dnsjava/security
Insightshttps://github.com/dnsjava/dnsjava/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fdnsjava%2Fdnsjava%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fdnsjava%2Fdnsjava%2Fissues%2Fnew%2Fchoose
twalmsleyhttps://github.com/twalmsley
dnsjava:masterhttps://github.com/dnsjava/dnsjava/tree/master
Conversation 2 https://github.com/dnsjava/dnsjava/pull/127
Commits 2 https://github.com/dnsjava/dnsjava/pull/127/commits
Checks 0 https://github.com/dnsjava/dnsjava/pull/127/checks
Files changed https://github.com/dnsjava/dnsjava/pull/127/files
Please reload this pagehttps://github.com/dnsjava/dnsjava/pull/127/files
Allow for an unknown content length. https://github.com/dnsjava/dnsjava/pull/127/files#top
Show all changes 2 commits https://github.com/dnsjava/dnsjava/pull/127/files
03717db Allow for an unknown content length. twalmsley Sep 8, 2020 https://github.com/dnsjava/dnsjava/pull/127/commits/03717db4512b4f26f8ad498385c9c975aa2b4caa
286bf47 Fix formatting. twalmsley Sep 8, 2020 https://github.com/dnsjava/dnsjava/pull/127/commits/286bf47466664da56aa7d725cb55c17dda5f87f4
Clear filters https://github.com/dnsjava/dnsjava/pull/127/files
Please reload this pagehttps://github.com/dnsjava/dnsjava/pull/127/files
Please reload this pagehttps://github.com/dnsjava/dnsjava/pull/127/files
src/main/java/org/xbill/DNS/DohResolver.javahttps://github.com/dnsjava/dnsjava/pull/127/files#diff-cdf6955f8f9f3a9d83ff5d67eb2b9d702d8e7ed852177b42c6aab3c1c243c69b
View file https://github.com/dnsjava/dnsjava/blob/286bf47466664da56aa7d725cb55c17dda5f87f4/src/main/java/org/xbill/DNS/DohResolver.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/dnsjava/dnsjava/pull/127/{{ revealButtonHref }}
https://github.com/dnsjava/dnsjava/pull/127/files#diff-cdf6955f8f9f3a9d83ff5d67eb2b9d702d8e7ed852177b42c6aab3c1c243c69b
https://github.com/dnsjava/dnsjava/pull/127/files#diff-cdf6955f8f9f3a9d83ff5d67eb2b9d702d8e7ed852177b42c6aab3c1c243c69b
https://github.com/dnsjava/dnsjava/pull/127/files#diff-cdf6955f8f9f3a9d83ff5d67eb2b9d702d8e7ed852177b42c6aab3c1c243c69b
https://github.com/dnsjava/dnsjava/pull/127/files#diff-cdf6955f8f9f3a9d83ff5d67eb2b9d702d8e7ed852177b42c6aab3c1c243c69b
https://github.com/dnsjava/dnsjava/pull/127/files#diff-cdf6955f8f9f3a9d83ff5d67eb2b9d702d8e7ed852177b42c6aab3c1c243c69b
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlno-cache

Viewport: width=device-width


URLs of crawlers that visited me.