Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased

## Fixed
- [client] Fixed issue where html errors were being displayed incorrectly in PR [1687](https://github.com/microsoft/BotFramework-Emulator/pull/1687/files)
- [client] Fixed an issue where webSpeechFactories in store were being set to null in PR [1685](https://github.com/microsoft/BotFramework-Emulator/pull/1685)

## v4.5.1 - 2019 - 07 - 13
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,13 @@ export class LogEntry extends React.Component<LogEntryProps> {
if (typeof body === 'string') {
try {
obj = JSON.parse(body);
// html responses come over as doubly stringified e.g.: ""<some html>"" and
// calling JSON.parse will turn them into a standard string;
// we want to assign the html to a property so that the string isn't expanded
// out into a giant object with one key per character
if (typeof obj === 'string') {
obj = { value: obj };
}
} catch (e) {
obj = body;
}
Expand Down
9 changes: 8 additions & 1 deletion packages/app/main/src/restServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,17 @@ export class RestServer {
level = LogLevel.Error;
}

let responseHeaders;
try {
responseHeaders = res.headers();
} catch (e) {
responseHeaders = undefined;
}

emulatorApplication.mainWindow.logService.logToChat(
conversationId,
networkRequestItem(facility, (req as any)._body, req.headers, req.method, req.url),
networkResponseItem((res as any)._data, res.headers, res.statusCode, res.statusMessage, req.url),
networkResponseItem((res as any)._data, responseHeaders, res.statusCode, res.statusMessage, req.url),
textItem(level, `${facility}.${routeName}`)
);
};
Expand Down