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

Unified Diff: lib/src/server/server.dart

Issue 1275203004: Remove the explicit setting of the hostname in the response (Closed) Base URL: git@github.com:dart-lang/appengine.git@master
Patch Set: Created 5 years, 4 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 | « CHANGELOG.md ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/server/server.dart
diff --git a/lib/src/server/server.dart b/lib/src/server/server.dart
index 30810ebca7da7c7e74a97e62a59006ea5c610a2f..260df6fcd156c3e5483bbd54b8a96ba4a70c207a 100644
--- a/lib/src/server/server.dart
+++ b/lib/src/server/server.dart
@@ -16,16 +16,12 @@ void _info(String message) {
print(formattedMessage);
}
-String _getHostname() =>
- (Process.runSync('/bin/hostname', []).stdout as String).trim();
-
class AppEngineHttpServer {
final ContextRegistry _contextRegistry;
final String _hostname;
final int _port;
- final String _localHostname;
final Completer _shutdownCompleter = new Completer();
int _pendingRequests = 0;
@@ -33,7 +29,7 @@ class AppEngineHttpServer {
AppEngineHttpServer(this._contextRegistry,
{String hostname: '0.0.0.0', int port: 8080})
- : _localHostname = _getHostname(), _hostname = hostname, _port = port;
+ : _hostname = hostname, _port = port;
Future get done => _shutdownCompleter.future;
@@ -52,7 +48,7 @@ class AppEngineHttpServer {
_info("Got request: ${appengineRequest.uri}");
- // Default handling is sending the request to the aplication.
+ // Default handling is sending the request to the application.
var handler = applicationHandler;
// Check if the request path is one of the service handlers.
@@ -66,13 +62,6 @@ class AppEngineHttpServer {
_pendingRequests++;
var context = _contextRegistry.add(appengineRequest);
- /*
- * This sets the 'Server' header in the http response to the hostname
- * of the machine the application is running on.
- * It seems like the AppEngine VmRuntime stub (on the other end) will
- * not accept the response if we use the default value.
- */
- appengineRequest.response.headers.set('Server', _localHostname);
appengineRequest.response.registerHook(
() => _contextRegistry.remove(appengineRequest));
« no previous file with comments | « CHANGELOG.md ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698