Respond to HTTP POST requests with 404 in WebAssetServer (#68492)
* Respond to POST with 404 in WebAssetServer
This commit is contained in:
@@ -333,6 +333,11 @@ class WebAssetServer implements AssetReader {
|
||||
// handle requests for JavaScript source, dart sources maps, or asset files.
|
||||
@visibleForTesting
|
||||
Future<shelf.Response> handleRequest(shelf.Request request) async {
|
||||
if (request.method != 'GET') {
|
||||
// Assets are served via GET only.
|
||||
return shelf.Response.notFound('');
|
||||
}
|
||||
|
||||
final String requestPath = _stripBasePath(request.url.path, basePath);
|
||||
|
||||
if (requestPath == null) {
|
||||
@@ -969,6 +974,11 @@ class ReleaseAssetServer {
|
||||
];
|
||||
|
||||
Future<shelf.Response> handle(shelf.Request request) async {
|
||||
if (request.method != 'GET') {
|
||||
// Assets are served via GET only.
|
||||
return shelf.Response.notFound('');
|
||||
}
|
||||
|
||||
Uri fileUri;
|
||||
final String requestPath = _stripBasePath(request.url.path, basePath);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user