diff options
author | Eugene Ostroukhov <eostroukhov@google.com> | 2018-03-06 06:18:17 +0300 |
---|---|---|
committer | Eugene Ostroukhov <eostroukhov@google.com> | 2018-04-02 20:20:30 +0300 |
commit | a9a1f12b4212c0ea81a04bf2eb56efe6f8a4699b (patch) | |
tree | b2a5827e9285f40d1e056d603ad2bd2b1e3e3769 /src/inspector_socket_server.h | |
parent | 6de1a12e496b58b1ab1c150b3cee8a8d45040edb (diff) |
inspector: report client-visible host and port
Node instance may not know the real host and port user sees when
debug frontend connects through the SSH tunnel. This change fixes
'/json/list' response by using the value client provided in the host
header.
PR-URL: https://github.com/nodejs/node/pull/19664
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Diffstat (limited to 'src/inspector_socket_server.h')
-rw-r--r-- | src/inspector_socket_server.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/inspector_socket_server.h b/src/inspector_socket_server.h index b193e33a46d..f6003c4c4b4 100644 --- a/src/inspector_socket_server.h +++ b/src/inspector_socket_server.h @@ -67,7 +67,8 @@ class InspectorSocketServer { // Session connection lifecycle void Accept(int server_port, uv_stream_t* server_socket); - bool HandleGetRequest(int session_id, const std::string& path); + bool HandleGetRequest(int session_id, const std::string& host, + const std::string& path); void SessionStarted(int session_id, const std::string& target_id, const std::string& ws_id); void SessionTerminated(int session_id); @@ -77,7 +78,8 @@ class InspectorSocketServer { SocketSession* Session(int session_id); private: - void SendListResponse(InspectorSocket* socket, SocketSession* session); + void SendListResponse(InspectorSocket* socket, const std::string& host, + SocketSession* session); bool TargetExists(const std::string& id); enum class ServerState {kNew, kRunning, kStopping, kStopped}; |