Refactor content type assertion in file tests for improved clarity

- Adjusted the assertion for content type in the file tests to enhance readability and maintainability.
- Ensured that the content type validation remains robust while checking for variations that may include charset.
This commit is contained in:
Max 2025-11-06 11:57:59 +08:00
parent 59c32bd1f6
commit 0b88fb6098

View file

@ -632,7 +632,7 @@ func TestFileContent(t *testing.T) {
assert.Equal(t, http.StatusOK, resp.StatusCode)
// Content type may include charset
assert.True(t, strings.HasPrefix(resp.Header.Get("Content-Type"), testContentType),
assert.True(t, strings.HasPrefix(resp.Header.Get("Content-Type"), testContentType),
"Content-Type should start with %s, got %s", testContentType, resp.Header.Get("Content-Type"))
// Read and verify content