Skip to content

Commit 2cee182

Browse files
committed
Comment out unused '/upload' case and static file serving in onMessage handler
1 parent 5bc9143 commit 2cee182

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

frameworks/workerman/server.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ function largeJson()
5757
$connection->headers = ['Content-Type' => 'application/json'];
5858
return $connection->send(json_encode(['items' => $total, 'count' => count($total)]));
5959

60-
case '/upload':
61-
$connection->headers = ['Content-Type' => 'text/plain'];
62-
return $connection->send(strlen($request->rawBody()));
60+
// case '/upload':
61+
// $connection->headers = ['Content-Type' => 'text/plain'];
62+
// return $connection->send(strlen($request->rawBody()));
6363

6464
case '/compression':
6565
if (str_contains($request->header('Accept-Encoding', ''), 'gzip')) {
@@ -84,10 +84,10 @@ function largeJson()
8484
}
8585

8686
// Serve static files
87-
if (str_starts_with($request->path(), '/static/')) {
88-
$response = (new Response())->withFile('/data' . $request->path());
89-
return $connection->send($response);
90-
}
87+
// if (str_starts_with($request->path(), '/static/')) {
88+
// $response = (new Response())->withFile('/data' . $request->path());
89+
// return $connection->send($response);
90+
// }
9191

9292
return $connection->send(new Response(
9393
404,

0 commit comments

Comments
 (0)