Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issue where html errors were being displayed incorrectly. #1687

Merged
merged 2 commits into from Jul 17, 2019
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -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
@@ -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;
}
@@ -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}`)
);
};
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.