rsnext/test
Joachim Viide d670198e7c
Add "Vary: Accept" header to /_next/image responses (#26788)
This pull request adds "Vary: Accept" header to responses from the image optimizer (i.e. the /_next/image endpoint).

The image optimizer prefers re-encoding JPG files to WebP, but some browsers (such as Safari 14 on Catalina) do not yet support WebP. In such cases the optimizer uses the Accept header sent by the browser to send out a JPG response. Thus the optimizer's response may depend on the Accept header.

Potential caching proxies can be informed of this fact by adding "Vary: Accept" to the response headers. Otherwise WebP data may be served to browsers that do not support it, for example in the following scenario:
 * A browser that supports WebP requests the JPG. The optimizer re-encodes it to WebP. The proxy caches the WebP data.
 * After this another browser that doesn't support WebP requests the JPG. The proxy sends the WebP data to the browser.

- [x] Integration tests added
- [x] Make sure the linting passes
2021-07-01 19:59:16 +00:00
..
.stats-app Simplify stats action (#26751) 2021-06-30 11:41:55 +02:00
acceptance Add helpful error for link with multiple children (#25657) 2021-05-31 19:41:57 +00:00
eslint-plugin-next Remove period for ESLint passHref docs link. (#26402) 2021-06-20 22:55:03 +00:00
integration Add "Vary: Accept" header to /_next/image responses (#26788) 2021-07-01 19:59:16 +00:00
isolated Move next-server directory files to server directory (#26756) 2021-06-30 13:44:40 +02:00
lib Ensure has query encoding is normalized (#25732) 2021-06-17 10:52:11 -05:00
package-managers/pnpm Add pnpm integration test (#17882) 2021-01-11 17:50:12 +01:00
unit Move next-server directory files to server directory (#26756) 2021-06-30 13:44:40 +02:00
.babelrc Include all files in Prettier (#17050) 2020-09-14 02:53:19 +00:00
.gitignore Universal Webpack (#3578) 2018-01-30 16:44:44 +01:00
jest-environment.js Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
jest-global-setup.js Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
jest-global-teardown.js Update CI/test set up (#9499) 2019-11-25 13:19:45 -05:00
jest-setup-after-env.js Only retry tests on CI (#12998) 2020-05-17 12:10:02 -04:00
test-file.txt Add additional file serving tests (#12479) 2020-05-04 11:58:19 -05:00
tsconfig.json Update tsconfig for tests 2020-01-21 15:29:39 -06:00