Skip to content

Commit

Permalink
src: fix method name, output format
Browse files Browse the repository at this point in the history
* add additional newline to HTTP GET JSON responses
* SendTargentsListResponse -> SendListResponse

PR-URL: #9627
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
joshgav authored and MylesBorins committed Dec 20, 2016
1 parent cbea672 commit f9fd53d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/inspector_agent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ std::string MapToString(const std::map<std::string, std::string> object) {
json << name_value.second << "\"";
first = false;
}
json << "\n} ]";
json << "\n} ]\n\n";
return json.str();
}

Expand Down Expand Up @@ -219,7 +219,7 @@ class AgentImpl {
void WaitForFrontendMessage();
void NotifyMessageReceived();
State ToState(State state);
void SendTargentsListResponse(InspectorSocket* socket);
void SendListResponse(InspectorSocket* socket);
bool RespondToGet(InspectorSocket* socket, const std::string& path);

uv_sem_t start_sem_;
Expand Down Expand Up @@ -639,7 +639,7 @@ void AgentImpl::OnRemoteDataIO(InspectorSocket* socket,
}
}

void AgentImpl::SendTargentsListResponse(InspectorSocket* socket) {
void AgentImpl::SendListResponse(InspectorSocket* socket) {
std::map<std::string, std::string> response;
response["description"] = "node.js instance";
response["faviconUrl"] = "https://nodejs.org/static/favicon.ico";
Expand Down Expand Up @@ -673,7 +673,7 @@ bool AgentImpl::RespondToGet(InspectorSocket* socket, const std::string& path) {
return false;

if (match_path_segment(command, "list") || command[0] == '\0') {
SendTargentsListResponse(socket);
SendListResponse(socket);
return true;
} else if (match_path_segment(command, "protocol")) {
SendProtocolJson(socket);
Expand Down

0 comments on commit f9fd53d

Please sign in to comment.