Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: CompareHeaders function fails to handle missing headers properly labels: bug, test-failure #9

Open
akshat99812 opened this issue Oct 23, 2024 · 0 comments · May be fixed by #10
Open

Comments

@akshat99812
Copy link

The CompareHeaders function currently fails to properly handle and display differences when expected headers are missing from the actual headers map.

Current Behavior
When an expected header is missing from the actual headers:

The test fails with error: "CompareHeaders() didn't properly show missing Authorization header"
The diff output doesn't properly highlight or indicate the missing header
The function may panic or produce incorrect output when trying to process missing values

Expected Behavior
When comparing headers and encountering missing values, the function should:

Clearly indicate which headers are missing in the actual headers
Mark missing headers appropriately in the diff visualization

The fails for
expected := map[string]string{
"Authorization": "Bearer token123",
"User-Agent": "test-client",
}
actual := map[string]string{
"User-Agent": "test-client",
}

Screenshot 2024-10-23 at 2 40 56 PM
@akshat99812 akshat99812 linked a pull request Oct 23, 2024 that will close this issue
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 a pull request may close this issue.

1 participant