borchero / Squid

Declarative and Reactive Networking for Swift.
https://squid.borchero.com
MIT License
71 stars 6 forks source link

Headers are getting URL encoded? #12

Closed kevinrenskers closed 4 years ago

kevinrenskers commented 4 years ago

In my HTTPService I set a header:

var header: HttpHeader {
  HttpHeader([
    .accept: HttpMimeType.json.rawValue,
    .authorization: "Bearer \(token)",
  ])
}

This is getting sent as Bearer%20DsNYO6w84ZaJBJyYWHEtStTBoRCquu3XAQc0tVH8ggq3orn7UAYGYvfrU8ZjYKQTHvKB2W28xZuUjMmZ, and the server really doesn't like this. Why is it getting encoded, and can I do something about that?

borchero commented 4 years ago

Ouh that shouldn't happen. I'll have a look what's going on here.

borchero commented 4 years ago

Fixed in release 1.3.2. I honestly don't know why the values where escaped in the first place though...

kevinrenskers commented 4 years ago

Yea, that seems like something the dev should do in their app code? Anyway, thanks again! :)