Skip to content

Fixed log ip sanitizer - #15

Merged
vtm9 merged 1 commit into
hexlet-codebattle:mainfrom
dimaush:fix-log_ip_sanitizer
Oct 16, 2026
Merged

vtm9 merged 1 commit into
hexlet-codebattle:mainfrom
dimaush:fix-log_ip_sanitizer

Conversation

@dimaush

@dimaush dimaush commented May 21, 2026

Copy link
Copy Markdown
Contributor

Раз уж по условию разрешены ведущие нули, то исправил тест, в котором из-за такого же ведущего нуля IP-адрес почему-то не признавался, а также исправил эталонное решение.

@vtm9 vtm9 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Allowing arbitrary leading zeros is a valid fix, but the new regex consumes invalid four-octet candidates and then skips valid addresses beginning inside them.

Reproduction: solution("999.1.2.3.4") currently returns "999.[REDACTED]"; this PR returns "999.1.2.3.4". The address 1.2.3.4 is valid and bounded by a dot and the string end, as the description permits. "256.001.002.003.004" has the same regression.

Please preserve scanning for valid addresses after a rejected candidate, while keeping leading-zero support, and add both regression cases. All 30 existing asserts pass, so additional coverage is needed.

@vtm9
vtm9 merged commit f4de5fd into hexlet-codebattle:main Oct 16, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants