Closed masihyeganeh closed 1 year ago
you're right that TrimRight
removes more than one =
char if the request has it.
I'll update the base64 encoder to use RawStdEncoding
which automatically omit padding.
Perfect. But one quick note here about DoH specification in RFC 8484 :
When the HTTP method is GET, the single variable "dns" is defined as the content of the DNS request (as described in Section 6, encoded with base64url (RFC4648).
So, the encoding should be URL instead of standard:
RFC 4648 without the =
at the end but with -
and _
instead of +
and /
looking at the RFC, sounds like RawURLEncoding
makes more sense than RawStdEncoding
. in Go's stdlib logs the same RFC is mentioned as well:
and the alphabet mentioned in stdlib corroborates the same:
I'll update the code. Thanks for pointing this out :)
Thanks for your awesome package. I'm trying to debug the problem I have with your sniproxy and I ended up with using DoH, but I see that
TrimSuffix
can't actually trim=
s if there are more than one, butTrimRight
does. Please make sure that I'm not wrong about it and please accept this small PR if I'm right. Thanks