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

Side by Side Diff: sdk/lib/_internal/pub/test/lish/utils.dart

Issue 298683003: Use shelf in pub's barback and admin servers. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library lish.utils; 5 library lish.utils;
6 6
7 import 'dart:convert'; 7 import 'dart:convert';
8 import 'dart:io';
9 8
10 import 'package:scheduled_test/scheduled_test.dart'; 9 import 'package:scheduled_test/scheduled_test.dart';
11 import 'package:scheduled_test/scheduled_server.dart'; 10 import 'package:scheduled_test/scheduled_server.dart';
12 import 'package:shelf/shelf.dart' as shelf; 11 import 'package:shelf/shelf.dart' as shelf;
13 12
14 import '../../lib/src/io.dart'; 13 import '../../lib/src/io.dart';
15 14
16 void handleUploadForm(ScheduledServer server, [Map body]) { 15 void handleUploadForm(ScheduledServer server, [Map body]) {
17 server.handle('GET', '/api/packages/versions/new', (request) { 16 server.handle('GET', '/api/packages/versions/new', (request) {
18 return server.url.then((url) { 17 return server.url.then((url) {
(...skipping 19 matching lines...) Expand all
38 void handleUpload(ScheduledServer server) { 37 void handleUpload(ScheduledServer server) {
39 server.handle('POST', '/upload', (request) { 38 server.handle('POST', '/upload', (request) {
40 // TODO(nweiz): Once a multipart/form-data parser in Dart exists, validate 39 // TODO(nweiz): Once a multipart/form-data parser in Dart exists, validate
41 // that the request body is correctly formatted. See issue 6952. 40 // that the request body is correctly formatted. See issue 6952.
42 return drainStream(request.read()) 41 return drainStream(request.read())
43 .then((_) => server.url) 42 .then((_) => server.url)
44 .then((url) => new shelf.Response.found(url.resolve('/create'))); 43 .then((url) => new shelf.Response.found(url.resolve('/create')));
45 }); 44 });
46 } 45 }
47 46
OLDNEW
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/barback/web_socket_api.dart ('k') | sdk/lib/_internal/pub/test/oauth2/utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698