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

Panic in "SelectQValueFast" on string "a;," #639

Open
RangelReale opened this issue Nov 5, 2024 · 0 comments
Open

Panic in "SelectQValueFast" on string "a;," #639

RangelReale opened this issue Nov 5, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@RangelReale
Copy link

If an Accept header contains a sequence of "semicolon" followed by "comma", we get a panic at negotiation.go:78.

runtime error: slice bounds out of range [-1:]

Add this to negotiation/negotiation_test.go to panic:

func TestPanic(t *testing.T) {
	assert.Equal(t, "", SelectQValueFast("a;,", []string{"d", "e"}))
}
@danielgtaylor danielgtaylor added the bug Something isn't working label Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants