Skip to content

Commit d1b8b12

Browse files
Merge pull request #6 from devwithkrishna/hotfix/logerror
DEVOPS-326 hotfix commit fix log
2 parents a50e4e8 + ef74860 commit d1b8b12

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app/quickapi.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ async def create_item(item: UserColorEntry):
4141
user_colour.append(item)
4242
print(user_colour)
4343
# Sanitize log message to prevent log injection
44-
sanitized_username = item.username.replace('\r\n', '').replace('\n', '')
45-
sanitized_color = item.color.replace('\r\n', '').replace('\n', '')
46-
logger.info("New user-color entry added: username=%s, color=%s", sanitized_username, sanitized_color)
44+
sanitized_username = item.name.replace('\r\n', '').replace('\n', '')
45+
sanitized_color = item.favorite_color.replace('\r\n', '').replace('\n', '')
46+
logger.info("New user-color entry added: name=%s, favorite_colour=%s", sanitized_username, sanitized_color)
4747
return item
4848

4949
# List all user_colour mappings

0 commit comments

Comments
 (0)