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

Side by Side Diff: pkg/shelf/lib/src/request.dart

Issue 223023003: Extract an http_parser package from shelf. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 6 years, 8 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
« no previous file with comments | « pkg/shelf/lib/src/message.dart ('k') | pkg/shelf/lib/src/response.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 shelf.request; 5 library shelf.request;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 9
10 // TODO(kevmoo): use UnmodifiableMapView from SDK once 1.4 ships 10 // TODO(kevmoo): use UnmodifiableMapView from SDK once 1.4 ships
11 import 'package:collection/wrappers.dart' as pc; 11 import 'package:collection/wrappers.dart' as pc;
12 import 'package:http_parser/http_parser.dart';
12 import 'package:path/path.dart' as p; 13 import 'package:path/path.dart' as p;
13 14
14 import 'message.dart'; 15 import 'message.dart';
15 import 'util.dart';
16 16
17 /// Represents an HTTP request to be processed by a Shelf application. 17 /// Represents an HTTP request to be processed by a Shelf application.
18 class Request extends Message { 18 class Request extends Message {
19 /// The remainder of the [requestedUri] path designating the virtual 19 /// The remainder of the [requestedUri] path designating the virtual
20 /// "location" of the request's target within the handler. 20 /// "location" of the request's target within the handler.
21 /// 21 ///
22 /// [pathInfo] may be an empty string, if [requestedUri ]targets the handler 22 /// [pathInfo] may be an empty string, if [requestedUri ]targets the handler
23 /// root and does not have a trailing slash. 23 /// root and does not have a trailing slash.
24 /// 24 ///
25 /// [pathInfo] is never null. If it is not empty, it will start with `/`. 25 /// [pathInfo] is never null. If it is not empty, it will start with `/`.
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 /// Convenience property to access [pathInfo] data as a [List]. 99 /// Convenience property to access [pathInfo] data as a [List].
100 List<String> get pathSegments { 100 List<String> get pathSegments {
101 var segs = p.url.split(pathInfo); 101 var segs = p.url.split(pathInfo);
102 if (segs.length > 0) { 102 if (segs.length > 0) {
103 assert(segs.first == p.url.separator); 103 assert(segs.first == p.url.separator);
104 segs.removeAt(0); 104 segs.removeAt(0);
105 } 105 }
106 return segs; 106 return segs;
107 } 107 }
108 } 108 }
OLDNEW
« no previous file with comments | « pkg/shelf/lib/src/message.dart ('k') | pkg/shelf/lib/src/response.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698