提交 b89f2b3f 编写于 作者: J John McCutchan

Update service isolate server script

上级 4a869b2e
......@@ -90,21 +90,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;
}
_onServerShutdown() {
}
......@@ -132,17 +117,15 @@ class Server {
request.uri.path == '/' ? ROOT_REDIRECT_PATH : request.uri.path;
if (path == WEBSOCKET_PATH) {
WebSocketTransformer.upgrade(request).then((WebSocket webSocket) {
WebSocketTransformer.upgrade(request,
compression: CompressionOptions.OFF).then(
(WebSocket webSocket) {
new WebSocketClient(webSocket, _service);
});
return;
}
Asset asset = assets[path];
if (asset == null && _shouldServeObservatory(request)) {
asset = assets[ROOT_REDIRECT_PATH];
assert(asset != null);
}
if (asset != null) {
// Serving up a static resource (e.g. .css, .html, .png).
request.response.headers.contentType =
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册