Fixed security analysis warnings

This commit is contained in:
thomashii@dukefirehawk.com 2022-08-27 16:01:12 +08:00
parent 45218176c7
commit 729a7740db
3 changed files with 7 additions and 3 deletions

View file

@ -92,7 +92,9 @@ class CookieSigner {
///
/// See [createSignedCookie].
void writeCookies(ResponseContext res, Iterable<Cookie> cookies) {
cookies.forEach((c) => writeCookie(res, c));
for (var c in cookies) {
writeCookie(res, c);
}
}
/// Returns a new cookie, replacing the value of an input
@ -104,7 +106,7 @@ class CookieSigner {
/// Where `sig` is the cookie's value, signed with the [hmac].
Cookie createSignedCookie(Cookie cookie) {
return cookieWithNewValue(
cookie, cookie.value + '.' + computeCookieSignature(cookie.value));
cookie, '${cookie.value}.${computeCookieSignature(cookie.value)}');
}
/// Returns a new [Cookie] that is the same as the input

View file

@ -35,7 +35,7 @@ class RateLimitingWindow<User> {
factory RateLimitingWindow.fromJson(Map<String, dynamic> map) {
return RateLimitingWindow(
(map['user'] as User?)!,
(map['user'] as User),
DateTime.parse(map['start_time'] as String),
int.parse(map['points_consumed'] as String));
}

View file

@ -16,6 +16,8 @@ dev_dependencies:
angel3_validate: ^7.0.0
belatuk_pretty_logging: ^5.0.0
test: ^1.21.0
logging: ^1.0.0
resp_client: ^1.2.0
lints: ^2.0.0
dependency_overrides:
angel3_production: