Wordpress/tests/phpunit/tests
James Nylen ce38b9c90a REST API: Avoid sending blank Last-Modified headers with authenticated requests.
This commit adds a new `WP_REST_Server#remove_header` method and uses it to clear the `Last-Modified` header when the "no caching" headers are sent (by default for all authenticated REST API requests).  This matches the behavior of the `nocache_headers` function used in other parts of WordPress.

Previously, the REST API would send an empty `Last-Modified` header in this situation.  Under some server and browser configurations, this causes browsers to cache authenticated REST API requests, which is undesirable.

Props iv3rson76, zinigor, rmccue, jnylen0.
Fixes #40444.


git-svn-id: https://develop.svn.wordpress.org/trunk@40805 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-19 20:26:48 +00:00
..
actions
admin Media: Ensure WP_Screen sets post type on wp-admin/upload.php. 2017-05-19 18:28:58 +00:00
ajax Build/Test Tools: Remove more unnecessary test skipping when erroneous situations occur. 2017-04-23 22:11:52 +00:00
attachment
bookmark
canonical Revert [40256] for now as some tests are failing in some environments. 2017-05-12 22:49:48 +00:00
category Taxonomy: Introduce get_term_parents_list(). 2016-12-09 16:09:31 +00:00
comment Fix broken check_comment() test. 2017-04-27 16:22:36 +00:00
customize Customize: Fix phpunit tests after [40704] due to logic inversion error. 2017-05-16 14:33:16 +00:00
date
db Tests: Restore the database connection earlier when switching test groups. 2016-12-21 04:58:47 +00:00
dependencies Build/Test Tools: Utilise assertFileExists() and assertFileNotExists() in more places. 2016-11-08 23:49:11 +00:00
external-http Build/Test Tools: Don't skip tests when php.net or dev.mysql.com are unreachable. 2017-04-22 18:44:18 +00:00
feed Build/Test Tools: Remove ancient UT ticket handling. 2017-04-22 19:38:42 +00:00
filesystem
formatting Formatting: Increase minimum characters allowed in is_email() to 6. 2017-05-14 04:19:51 +00:00
functions Build/Test Tools: Remove more unnecessary test skipping when erroneous situations occur. 2017-04-23 22:11:52 +00:00
general Build/Test Tools: Automatically skip tests in the ms-required and ms-excluded groups. 2017-05-01 20:34:10 +00:00
hooks
http Build/Test Tools: Remove more skipped tests that should actually be failures if their conditions aren't satisfied. 2017-04-22 19:42:12 +00:00
image Build/Test Tools: Remove more unnecessary test skipping when erroneous situations occur. 2017-04-23 22:11:52 +00:00
import Import: Replace assert() calls with PHPUnit's assertTrue() method. 2017-05-12 07:37:33 +00:00
includes
l10n Build/Test Tools: Automatically skip tests in the ms-required and ms-excluded groups. 2017-05-01 20:34:10 +00:00
link Build/Test Tools: Automatically skip tests in the ms-required and ms-excluded groups. 2017-05-01 20:34:10 +00:00
load
media
menu
meta
multisite Multisite: Adjust site count of the correct network after having created a new site. 2017-05-10 23:21:43 +00:00
oembed REST API: Add endpoint for proxying requests to external oEmbed providers. 2017-05-11 18:18:00 +00:00
option Build/Test Tools: Automatically skip tests in the ms-required and ms-excluded groups. 2017-05-01 20:34:10 +00:00
pomo
post Customize: Keep alive auto-drafts created for page/post stubs when parent changeset is updated, and delete when changeset is garbage-collected. 2017-05-16 05:36:25 +00:00
query REST API: Add author, modified, and parent sort order options for posts. 2017-05-10 18:51:28 +00:00
rest-api REST API: Avoid sending blank Last-Modified headers with authenticated requests. 2017-05-19 20:26:48 +00:00
rewrite Tests: Restore the database connection earlier when switching test groups. 2016-12-21 04:58:47 +00:00
taxonomy
term Restore support for taxonomy 'args' override when querying object terms. 2017-04-21 19:13:51 +00:00
theme Build/Test Tools: Automatically skip tests in the ms-required and ms-excluded groups. 2017-05-01 20:34:10 +00:00
user Mail: Ensure entities are decoded in email change notifications on Multisite. 2017-05-11 19:14:55 +00:00
widgets Widgets: Remove image sizes generated during media widget phpunit tests from being version controlled. 2017-05-15 22:58:03 +00:00
xmlrpc Build/Test tools: Introduce and implement assertNotIXRError() and assertIXRError() assertion methods. 2017-04-12 14:58:33 +00:00
actions.php
adminbar.php Users: Correct a permission check when showing the User item in the + New admin toolbar menu. 2017-05-07 17:41:24 +00:00
auth.php Build/Test Tools: Add an extra WP_Error assertion when testing a valid user activation key. This provides a better failure message if the assertion does fail. 2016-11-27 01:24:58 +00:00
avatar.php
basic.php Build/Test: Revert that failing test. 2017-05-11 00:15:05 +00:00
cache.php Multisite: Remove unused site-lookup global cache group. 2017-03-28 21:07:22 +00:00
canonical.php
category.php
comment-submission.php Comments: When commenting on a draft post, display a friendly error message if the user can view the post. 2017-02-27 00:22:02 +00:00
comment.php
compat.php
cron.php Build/Test Tools: Remove commented out tests that have existed in an unimplemented state since the dawn of the test infrastructure. 2016-12-09 23:11:28 +00:00
db.php Build/Test Tools: Remove more unnecessary test skipping when erroneous situations occur. 2017-04-23 22:11:52 +00:00
dbdelta.php Tests: Use utf8mb4 max index length when creating keys. 2017-03-27 19:33:55 +00:00
dependencies.php
file.php
filters.php Plugins: Add a current_priority() method to WP_Hook. 2016-12-02 07:09:33 +00:00
functions.php Build/Test Tools: Automatically skip tests in the ms-required and ms-excluded groups. 2017-05-01 20:34:10 +00:00
kses.php KSES: Support 'tag' => true as a shorthand for 'tag' => array() in wp_kses_attr(). 2017-05-11 19:22:17 +00:00
l10n.php I18N: In wp_dropdown_languages() rename the new show_site_locale_default argument to show_option_site_default. 2016-11-21 16:14:01 +00:00
link.php
locale.php
mail.php Mail: Set a better error code when triggering wp_mail_failed. 2016-11-02 04:26:18 +00:00
media.php Media: Avoid PHP Warnings in get_post_galleries() when processing empty [gallery] shortcodes and avoid returning the incorrect results when the global $post does not match the provided post ID. 2017-02-17 06:45:31 +00:00
meta.php
multisite.php
pluggable.php
post.php Build/Test Tools: Utilise assertWPError() and assertNotWPError() in more places. 2016-11-09 00:01:42 +00:00
query.php Built/Test Tools: Unify the way the permastructure is set when used in conjunction with re-registering the initial taxonomies. This ensure that rewrite rules for taxonomies are consistently available. 2016-09-26 17:01:48 +00:00
rest-api.php REST API: Fix multiple issues with setting dates of posts and comments. 2017-02-21 18:17:32 +00:00
rewrite.php Build/Test Tools: Automatically skip tests in the ms-required and ms-excluded groups. 2017-05-01 20:34:10 +00:00
shortcode.php
taxonomy.php Taxonomy: Disallow overriding the name property when registering a taxonomy. 2017-02-06 19:38:36 +00:00
template.php Posts, Post Types: Revert [40558] pending investigation. 2017-04-30 11:18:43 +00:00
term.php
theme.php Customize: Keep alive auto-drafts created for page/post stubs when parent changeset is updated, and delete when changeset is garbage-collected. 2017-05-16 05:36:25 +00:00
upload.php Build/Test Tools: Remove ancient UT ticket handling. 2017-04-22 19:38:42 +00:00
url.php
user.php Build/Test Tools: Automatically skip tests in the ms-required and ms-excluded groups. 2017-05-01 20:34:10 +00:00
walker.php
widgets.php
wp.php