📝 Description
The current app (CreateGreeting and the HTTP handler) does not handle edge cases in the name query parameter. This can result in:
- Unhelpful or inconsistent logs when
name is empty, whitespace-only, or malformed
- Potential for log injection or hard-to-read logs due to special characters (e.g., newlines)
- Poor UX when names contain only whitespace or very long strings
We want to harden the input handling to make the app safer and the logs cleaner.
✅ Acceptance Criteria
🧪 Sample Unit Test Cases to Add
func TestGreeting_WhitespaceOnly(t *testing.T) { ... }
func TestGreeting_LongName(t *testing.T) { ... }
func TestGreeting_NewlineInjection(t *testing.T) { ... }
🧩 Notes
This is a minimal, self-contained enhancement ideal for evaluating Copilot’s issue assignment capabilities. It:
- Involves logic + test changes
- Doesn’t require any external APIs
- Keeps scope limited but realistic
- Touches areas where Copilot should excel (sanitization, string ops, tests)
📝 Description
The current app (
CreateGreetingand the HTTP handler) does not handle edge cases in thenamequery parameter. This can result in:nameis empty, whitespace-only, or malformedWe want to harden the input handling to make the app safer and the logs cleaner.
✅ Acceptance Criteria
Input validation (in
CreateGreeting):"Hello, Guest"if input is empty after trimLogging safety (in HTTP handler):
namebefore logging (e.g., remove newline/control chars)Test coverage:
Jane!@#)🧪 Sample Unit Test Cases to Add
🧩 Notes
This is a minimal, self-contained enhancement ideal for evaluating Copilot’s issue assignment capabilities. It: