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

Unified Diff: runtime/bin/vmservice/server.dart

Issue 1261483003: Stop sniffing user agent in vm service http server (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/vmservice/server.dart
diff --git a/runtime/bin/vmservice/server.dart b/runtime/bin/vmservice/server.dart
index 2c6aa6639b225e5d639b2e96a2217b5da1f67867..c5a9acdd222ccb589890bf4c1e9d6099350786f7 100644
--- a/runtime/bin/vmservice/server.dart
+++ b/runtime/bin/vmservice/server.dart
@@ -95,21 +95,6 @@ class Server {
_displayMessages = (_ip != '127.0.0.1' || _port != 8181);
}
- bool _shouldServeObservatory(HttpRequest request) {
- if (request.headers['Observatory-Version'] != null) {
- // Request is already coming from Observatory.
- return false;
- }
- // TODO(johnmccutchan): Test with obscure browsers.
- if (request.headers.value(HttpHeaders.USER_AGENT).contains('Mozilla')) {
- // Request is coming from a browser but not Observatory application.
- // Serve Observatory and let the Observatory make the real request.
- return true;
- }
- // All other user agents are assumed to be textual.
- return false;
- }
-
void _requestHandler(HttpRequest request) {
// Allow cross origin requests with 'observatory' header.
request.response.headers.add('Access-Control-Allow-Origin', '*');
@@ -133,10 +118,6 @@ class Server {
}
var resource = Resource.resources[path];
- if (resource == null && _shouldServeObservatory(request)) {
- resource = Resource.resources[ROOT_REDIRECT_PATH];
- assert(resource != null);
- }
if (resource != null) {
// Serving up a static resource (e.g. .css, .html, .png).
request.response.headers.contentType =
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698