Skip to content

Not all headers roundtrip correctly #144

Closed

Description

@nielsenko

Describe the bug

A HeaderAccessor<T> is associated with a Codec<T> that handles encoding and decoding to String.

It is paramount that all headers roundtrip, meaning that encoding and decoding a header instance will give you a logically equivalent instance.

Most headers already does this correctly, but there are exceptions. We should add test to expose this, and fix all headers in conflict.

To reproduce

Example:

final x == VaryHeader.wildcard();
final r = Headers.vary.codec.encode(x);
final y == Headers.vary.codec.decode(r);
print(x == y); // <-- prints false! 

Expected behavior

Round-tripping headers should always result in a logically equal instances.

Library version

relic: 0.5.0 (and prior)

Platform information

any

Additional context

No response

How experienced are you with this library?

Expert - Experienced and comfortable with using this library in complex projects

Are you interested in working on a PR for this?

  • I want to work on this

Activity

  1. added
    bug
    on Sep 3, 2025
  2. self-assigned this
    on Sep 3, 2025
  3. nielsenko commented on Sep 3, 2025

    @nielsenko
    CollaboratorAuthor

    This is somewhat related to #143 , but even with that fixed, some headers simply don't encode and decode correctly.

  4. nielsenko commented on Sep 3, 2025

    @nielsenko
    CollaboratorAuthor

    So far the examples I have seen has been down to constructing invalid header instances in the first place (see #145)

  5. changed the title [-]bug: Not all headers roundtrip correctly[/-] [+]Not all headers roundtrip correctly[/+] on Sep 4, 2025
  6. moved this from Inbox 📫 to In Progress 🔥 in Serverpod Frameworkson Sep 4, 2025
  7. moved this from In Progress 🔥 to Done 🚀 in Serverpod Frameworkson Sep 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions