gnarroway / hato

An HTTP client for Clojure, wrapping JDK 11's HttpClient
MIT License
380 stars 27 forks source link

Propagate multipart exceptions and accept custom charsets #56

Closed vincentjames501 closed 1 year ago

vincentjames501 commented 1 year ago
gnarroway commented 1 year ago

Thanks will take a look. Does this have any impact on https://github.com/gnarroway/hato/issues/55 ?

vincentjames501 commented 1 year ago

Thanks will take a look. Does this have any impact on #55 ?

@gnarroway , it doesn't attempt to fix #55 . We likely want to loop through the parts and do our best to determine the content length of each part similar to how OkHttp does when determining the content length header. We can only report the content length if we can accurately determine the size of each part so it's fine if it's each part is a File/String/ByteArray/etc.

https://github.com/square/okhttp/blob/f9901627431be098ad73abd725fbb3738747461c/okhttp/src/jvmMain/kotlin/okhttp3/MultipartBody.kt#L109 https://github.com/square/okhttp/blob/f9901627431be098ad73abd725fbb3738747461c/okhttp/src/jvmTest/java/okhttp3/MultipartBodyTest.java#L27

vincentjames501 commented 1 year ago

@gnarroway , I took a crack at addressing #55 . Appears to be working for me but could certainly use some smoke testing. CC @p-himik

p-himik commented 1 year ago

After a quick test, it seems to work just fine on my end, including the fix for #55.