From 6c64d191ab5b10a0cc21ae51106df9cab881c249 Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Mon, 13 Jan 2020 08:41:35 +0800 Subject: [PATCH] remove responding 204 for unexisted players --- app/Http/Controllers/AdminController.php | 1 - config/options.php | 1 - resources/lang/en/options.yml | 4 ---- resources/misc/changelogs/en/5.0.0.md | 1 + resources/misc/changelogs/zh_CN/5.0.0.md | 1 + tests/BrowserKitTests/AdminFormsTest.php | 2 -- 6 files changed, 2 insertions(+), 8 deletions(-) diff --git a/app/Http/Controllers/AdminController.php b/app/Http/Controllers/AdminController.php index c7733b67..62831f0a 100644 --- a/app/Http/Controllers/AdminController.php +++ b/app/Http/Controllers/AdminController.php @@ -341,7 +341,6 @@ class AdminController extends Controller $resources = Option::form('resources', OptionForm::AUTO_DETECT, function ($form) { $form->checkbox('force_ssl')->label()->hint(); $form->checkbox('auto_detect_asset_url')->label()->description(); - $form->checkbox('return_204_when_notfound')->label()->description(); $form->text('cache_expire_time')->hint(OptionForm::AUTO_DETECT); $form->text('cdn_address') diff --git a/config/options.php b/config/options.php index 372cdc9f..0e93e95c 100644 --- a/config/options.php +++ b/config/options.php @@ -29,7 +29,6 @@ return [ 'auto_del_invalid_texture' => 'false', 'allow_downloading_texture' => 'true', 'texture_name_regexp' => '', - 'return_204_when_notfound' => 'false', 'cache_expire_time' => '31536000', 'max_upload_file_size' => '1024', 'force_ssl' => 'false', diff --git a/resources/lang/en/options.yml b/resources/lang/en/options.yml index 64a36c19..14f4e5f6 100644 --- a/resources/lang/en/options.yml +++ b/resources/lang/en/options.yml @@ -179,10 +179,6 @@ resources: title: Assets URL label: Determine assets url automatically. description: Please unable this if assets URLs are wrongly generated under a CDN. The site url will be used if this is not enabled. - return_204_when_notfound: - title: HTTP Response Code - label: Return 204 instead of 404 when requesting non-existent player. - description: If your CDN doesn't cache 404 pages, please turn this on. A flood of requests to non-existent players will greatly slow down the site. cache_expire_time: title: Cache Exipre Time hint: In seconds, 86400 = one day, 31536000 = one year. diff --git a/resources/misc/changelogs/en/5.0.0.md b/resources/misc/changelogs/en/5.0.0.md index 7bdf0a03..17df6032 100644 --- a/resources/misc/changelogs/en/5.0.0.md +++ b/resources/misc/changelogs/en/5.0.0.md @@ -68,6 +68,7 @@ - Removed auto update check. - Removed cache for Profile JSON. - Removed cache for existence of player. +- Removed settings of "Respond 204 for unexisted players". (Install plugin if you need it.) ## Internal Changes diff --git a/resources/misc/changelogs/zh_CN/5.0.0.md b/resources/misc/changelogs/zh_CN/5.0.0.md index 3a414396..ccfce7c5 100644 --- a/resources/misc/changelogs/zh_CN/5.0.0.md +++ b/resources/misc/changelogs/zh_CN/5.0.0.md @@ -68,6 +68,7 @@ - 移除自动更新检查 - 移除对 Profile JSON 的缓存 - 移除对角色存在与否的缓存 +- 移除「对不存在的角色返回 204」的选项(如有需要,请安装插件) ## 内部更改 diff --git a/tests/BrowserKitTests/AdminFormsTest.php b/tests/BrowserKitTests/AdminFormsTest.php index 382b2ffb..0ac1c755 100644 --- a/tests/BrowserKitTests/AdminFormsTest.php +++ b/tests/BrowserKitTests/AdminFormsTest.php @@ -171,13 +171,11 @@ class AdminFormsTest extends BrowserKitTestCase $this->visit('/admin/resource') ->check('force_ssl') ->uncheck('auto_detect_asset_url') - ->check('return_204_when_notfound') ->type('0', 'cache_expire_time') ->type('url/', 'cdn_address') ->press('submit_resources'); $this->assertTrue(option('force_ssl')); $this->assertFalse(option('auto_detect_asset_url')); - $this->assertTrue(option('return_204_when_notfound')); $this->assertEquals('0', option('cache_expire_time')); $this->visit('/')->see('url/app/');