fix: Handle content encoding in `hasContentType`
I suppose we could be even more correct at the cost of some performance, e.g split at ; and only check the head, but I don't think it's worth it.
@frekw are you still on this?
@tusharmath yeah, sorry, I've just been strapped on time. I rewrote it using HttpUtil which should be optimized enough (and also handle more edge cases from the spec).
Codecov Report
Merging #1140 (8d44fb3) into main (6aa1aef) will increase coverage by
0.93%. The diff coverage is87.50%.
@@ Coverage Diff @@
## main #1140 +/- ##
==========================================
+ Coverage 58.01% 58.94% +0.93%
==========================================
Files 74 74
Lines 2427 2470 +43
Branches 79 69 -10
==========================================
+ Hits 1408 1456 +48
+ Misses 1019 1014 -5
| Impacted Files | Coverage Δ | |
|---|---|---|
| ...c/main/scala/zhttp/http/headers/HeaderChecks.scala | 80.00% <83.33%> (ø) |
|
| .../main/scala/zhttp/http/headers/HeaderGetters.scala | 32.80% <100.00%> (+0.54%) |
:arrow_up: |
| .../src/main/scala/zhttp/http/HttpDataExtension.scala | 88.88% <0.00%> (-11.12%) |
:arrow_down: |
| zio-http/src/main/scala/zhttp/http/Response.scala | 83.58% <0.00%> (-1.27%) |
:arrow_down: |
| ...io-http/src/main/scala/zhttp/service/package.scala | 100.00% <0.00%> (ø) |
|
| ...la/zhttp/service/client/ClientInboundHandler.scala | 71.42% <0.00%> (ø) |
|
| ...erver/content/handlers/ServerResponseHandler.scala | ||
| ...ain/scala/zhttp/service/ServerResponseWriter.scala | 96.66% <0.00%> (ø) |
|
| ...ttp/src/main/scala/zhttp/service/HttpRuntime.scala | 77.77% <0.00%> (+0.35%) |
:arrow_up: |
| zio-http/src/main/scala/zhttp/http/HttpData.scala | 73.33% <0.00%> (+0.36%) |
:arrow_up: |
| ... and 9 more |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update 6aa1aef...8d44fb3. Read the comment docs.