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

Unified Diff: sdk/lib/io/http_impl.dart

Issue 125743002: Add HttpRequest::requestedUri. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Provide fall-back host and port. Created 6 years, 11 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
Index: sdk/lib/io/http_impl.dart
diff --git a/sdk/lib/io/http_impl.dart b/sdk/lib/io/http_impl.dart
index 4c6e74b862dcc67a34a825c5389fa0fbe972a65c..8e82ccbbfabc3bb93f4dd1296b1453443316f4d4 100644
--- a/sdk/lib/io/http_impl.dart
+++ b/sdk/lib/io/http_impl.dart
@@ -127,6 +127,13 @@ class _HttpRequest extends _HttpInboundMessage implements HttpRequest {
Uri get uri => _incoming.uri;
+ Uri get absoluteUri {
+ var scheme = _httpConnection._socket is SecureSocket ? "https" : "http";
+ var port = headers.port != null ? headers.port : _httpServer.port;
+ var host = headers.host != null ? headers.host : _httpServer.address.host;
+ return Uri.parse("$scheme://$host:$port$uri");
+ }
+
String get method => _incoming.method;
HttpSession get session {

Powered by Google App Engine
This is Rietveld 408576698