headers
headers copied to clipboard
implement as_str(), Display for Referer
So you can get the value out 😇 I just copied the implementation from the UserAgent type.
ok, tests were failing for good reason, i forgot to run them locally first…
Thanks for the PR! 😀
I haven't really thought about this, but curious to hear what you think: is it right to model the Referer as always a UTF-8 string? I guess it's usually going to be a URI, right? And so far in http, we've assumed that needs to be UTF-8...
i think it's OK to model it as always a URI … technically you could make a request that has some arbitrary data in there, but i don't think anyone intentionally wants to receive non-URIs in the referer field. browsers would only send a URI.
Actually, that reminds me. If we expose an as_str(), then we can't ever change this header to actually hold an http::Uri, for example, since that splits the string into 3 pieces. What if we just merge an impl Display for now?
With #122 merged, I think this should be closed.
great! 😁