Skip to content
Open
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
4 changes: 2 additions & 2 deletions include/tscore/ParseRules.h
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ inline CTypeResult
ParseRules::is_token(char c)
{
#ifndef COMPILE_PARSE_RULES
return (parseRulesCType[static_cast<unsigned char>(c)] & is_token_BIT);
return (parseRulesCType[(unsigned char)c] & is_token_BIT);
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed from static_cast<unsigned char> to C-style cast (unsigned char). C++ best practice is to use static_cast for type safety and clarity. This change appears unrelated to the PR's stated purpose of fixing '@' validation.

Suggested change
return (parseRulesCType[(unsigned char)c] & is_token_BIT);
return (parseRulesCType[static_cast<unsigned char>(c)] & is_token_BIT);

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no C casts, please

#else
return (is_char(c) && !(is_ctl(c) || is_tspecials(c)));
#endif
Expand Down Expand Up @@ -712,7 +712,7 @@ ParseRules::is_http_field_name(char c)
#ifndef COMPILE_PARSE_RULES
return (parseRulesCType[static_cast<unsigned char>(c)] & is_http_field_name_BIT);
#else
if (!is_char(c) || is_control(c) || (is_mime_sep(c) && c != '@') || c == '=' || c == ':') {
if (!is_char(c) || is_control(c) || is_mime_sep(c) || c == '=' || c == ':') {
return false;
}
return true;
Expand Down