Skip to content
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -483,8 +483,8 @@ class HttpRequestCookiesView extends StatelessWidget {
_buildCell(cookie.path),
_buildCell(cookie.expires?.toString()),
_buildCell(cookie.value!.length.toString()),
_buildIconCell(!cookie.httpOnly ? Icons.check : Icons.close),
_buildIconCell(!cookie.secure ? Icons.check : Icons.close),
_buildIconCell(cookie.httpOnly ? Icons.check : Icons.close),
_buildIconCell(cookie.secure ? Icons.check : Icons.close),
],
],
);
Expand Down
4 changes: 3 additions & 1 deletion packages/devtools_app/release_notes/NEXT_RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ TODO: Remove this section if there are not any updates.

## Network profiler updates

TODO: Remove this section if there are not any updates.
* Fixed the HttpOnly and Secure columns of the Cookies tab, which showed a
check mark for cookies that did not have those flags set.
[#10053](https://github.com/flutter/devtools/pull/10053)

## Logging updates

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,5 +355,29 @@ void main() {
await tester.pumpAndSettle(const Duration(seconds: 1));
},
);

testWidgets('cookie HttpOnly and Secure columns match the cookie', (
tester,
) async {
final cookieJson = Map<String, Object?>.of(httpGetJson)
..['response'] = {
...httpGetJson['response'] as Map<String, Object?>,
'cookies': ['sid=1; HttpOnly'],
};
final cookieRequest = DartIOHttpRequestData(
HttpProfileRequest.parse(cookieJson)!,
requestFullDataFromVmService: false,
);

await tester.pumpWidget(wrap(HttpRequestCookiesView(cookieRequest)));

// The cookie is HttpOnly but not Secure.
final cells = find.descendant(
of: find.byKey(HttpRequestCookiesView.responseCookiesKey),
matching: find.byType(Icon),
);
final icons = tester.widgetList<Icon>(cells).map((icon) => icon.icon);
expect(icons, [Icons.check, Icons.close]);
});
});
}
Loading