Skip to content

Commit d52900e

Browse files
committed
fix: test handler returns 204 by default
1 parent 84c9280 commit d52900e

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# 1.0.0
22
## Breaking Changes
33
* Flow\Exception was replaced by Flow\FileOpenException and Flow\FileLockException
4-
* php requirement was changed to >=5.4
4+
* php requirement was changed to >=5.4
5+
* if chunk was not found, 204 status is returned instead of 404

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
3535
if ($file->checkChunk()) {
3636
header("HTTP/1.1 200 Ok");
3737
} else {
38-
header("HTTP/1.1 404 Not Found");
38+
header("HTTP/1.1 204 No Content");
3939
return ;
4040
}
4141
} else {

src/Flow/Basic.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ public static function save($destination, $config, RequestInterface $request = n
3030
if ($file->checkChunk()) {
3131
header("HTTP/1.1 200 Ok");
3232
} else {
33-
header("HTTP/1.1 404 Not Found");
34-
33+
// The 204 response MUST NOT include a message-body, and thus is always terminated by the first empty line after the header fields.
34+
header("HTTP/1.1 204 No Content");
3535
return false;
3636
}
3737
} else {
@@ -40,7 +40,6 @@ public static function save($destination, $config, RequestInterface $request = n
4040
} else {
4141
// error, invalid chunk upload request, retry
4242
header("HTTP/1.1 400 Bad Request");
43-
4443
return false;
4544
}
4645
}

0 commit comments

Comments
 (0)