We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Description when issuing several requests at once, they all return the same response, if the hostname resolves to the same IP.
host
To Reproduce run the following:
const { fetch } = require('@adobe/helix-fetch').context({ // httpProtocol: 'http1', // httpsProtocols: ['http1'], }); const crypto = require('crypto'); async function request(url) { console.log('requesting', url) const res = await fetch(url, { // headers: { // host: new URL(url).hostname, // }, cache: 'no-store', }); const data = await res.text(); const md5 = crypto.createHash('md5').update(data).digest().toString('hex'); console.log('result', url, 'md5=', md5, res.headers.raw()); } async function run() { await Promise.all([ request('https://lr-landing-davidnuescheler.project-helix.page/'), request('https://n2-davidnuescheler.hlx.page/index.html'), request('https://theblog--adobe.hlx.page/index.html'), ]); } run().catch(console.error);
result:
$ node index.js requesting https://lr-landing-davidnuescheler.project-helix.page/ requesting https://n2-davidnuescheler.hlx.page/index.html requesting https://theblog--adobe.hlx.page/index.html result https://theblog--adobe.hlx.page/index.html md5= 22971378ba99ace7ba88e6474e7e0c04 { 'cache-control': 'max-age=604800, must-revalidate, private', 'content-type': 'text/html; charset=UTF-8', link: '<https://lr-landing-davidnuescheler.project-helix.page/index.html>; rel="canonical"', date: 'Thu, 11 Jun 2020 05:18:39 GMT', age: '0', vary: 'X-Debug,X-Strain,X-Request-Type', 'strict-transport-security': 'max-age=31536000', 'x-version': '332; src=332; cli=5.8.2; rev=online' } result https://n2-davidnuescheler.hlx.page/index.html md5= 22971378ba99ace7ba88e6474e7e0c04 { 'cache-control': 'max-age=604800, must-revalidate, private', 'content-type': 'text/html; charset=UTF-8', link: '<https://lr-landing-davidnuescheler.project-helix.page/index.html>; rel="canonical"', date: 'Thu, 11 Jun 2020 05:18:39 GMT', age: '0', vary: 'X-Debug,X-Strain,X-Request-Type', 'strict-transport-security': 'max-age=31536000', 'x-version': '332; src=332; cli=5.8.2; rev=online' } result https://lr-landing-davidnuescheler.project-helix.page/ md5= 22971378ba99ace7ba88e6474e7e0c04 { 'cache-control': 'max-age=604800, must-revalidate, private', 'content-type': 'text/html; charset=UTF-8', link: '<https://lr-landing-davidnuescheler.project-helix.page/index.html>; rel="canonical"', date: 'Thu, 11 Jun 2020 05:18:39 GMT', age: '0', vary: 'X-Debug,X-Strain,X-Request-Type', 'strict-transport-security': 'max-age=31536000', 'x-version': '332; src=332; cli=5.8.2; rev=online' }
The text was updated successfully, but these errors were encountered:
See fetch-h2 issue.
Sorry, something went wrong.
fix: explicitly set Host header
331fcc9
#52
chore(release): 1.6.2 [skip ci]
a534084
## [1.6.2](v1.6.1...v1.6.2) (2020-06-15) ### Bug Fixes * explicitly set Host header ([331fcc9](331fcc9)), closes [#52](#52)
implemented workaround in 331fcc9
will remove workaround once/if the underlying fetch-h2 issue gets fixed.
stefan-guggisberg
No branches or pull requests
Description
when issuing several requests at once, they all return the same response, if the hostname resolves to the same IP.
host
header solves the problem.To Reproduce
run the following:
result:
The text was updated successfully, but these errors were encountered: