Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(459)

Unified Diff: lib/src/util/one_off_handler.dart

Issue 1290763003: Drop support for old SDK and shelf versions. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Code review changes Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/src/util/isolate_wrapper.dart ('k') | lib/src/util/path_handler.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/util/one_off_handler.dart
diff --git a/lib/src/util/one_off_handler.dart b/lib/src/util/one_off_handler.dart
index 442a76486590504b3c606904899641d2be525290..661dd91decfd72fec9dff25dd6570d8929c233cd 100644
--- a/lib/src/util/one_off_handler.dart
+++ b/lib/src/util/one_off_handler.dart
@@ -7,8 +7,6 @@ library test.util.one_off_handler;
import 'package:path/path.dart' as p;
import 'package:shelf/shelf.dart' as shelf;
-import '../utils.dart';
-
/// A Shelf handler that provides support for one-time handlers.
///
/// This is useful for handlers that only expect to be hit once before becoming
@@ -38,12 +36,12 @@ class OneOffHandler {
/// Dispatches [request] to the appropriate handler.
_onRequest(shelf.Request request) {
- var components = p.url.split(shelfUrl(request).path);
+ var components = p.url.split(request.url.path);
if (components.isEmpty) return new shelf.Response.notFound(null);
var path = components.removeAt(0);
var handler = _handlers.remove(path);
if (handler == null) return new shelf.Response.notFound(null);
- return handler(shelfChange(request, path: path));
+ return handler(request.change(path: path));
}
}
« no previous file with comments | « lib/src/util/isolate_wrapper.dart ('k') | lib/src/util/path_handler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698