Skip to content

Conversation

@binaryfire
Copy link
Contributor

The varyHeader method had a bug when handling responses with multiple Vary header values:

  • Used wrong arguments: passed the header value as the header name
  • Passed false as the header value (invalid)
  • Didn't assign the result, so the line did nothing

Fixed by simplifying to always use implode() to combine existing Vary header values with the new header.

Added tests covering:

  • Adding Vary header when none exists
  • Appending to existing single header
  • Not duplicating existing headers
  • Handling multiple Vary header values (the bug case)

The varyHeader method had a bug when handling responses with multiple
Vary header values:
- Used wrong arguments: passed the header value as the header name
- Passed `false` as the header value (invalid)
- Didn't assign the result, so the line did nothing

Fixed by simplifying to always use implode() to combine existing
Vary header values with the new header.

Added tests covering:
- Adding Vary header when none exists
- Appending to existing single header
- Not duplicating existing headers
- Handling multiple Vary header values (the bug case)
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 this pull request may close these issues.

1 participant