zio-http icon indicating copy to clipboard operation
zio-http copied to clipboard

fix: Handle content encoding in `hasContentType`

Open frekw opened this issue 4 years ago • 3 comments

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 avatar Mar 17 '22 22:03 frekw

@frekw are you still on this?

tusharmath avatar Apr 18 '22 12:04 tusharmath

@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).

frekw avatar Apr 21 '22 11:04 frekw

Codecov Report

Merging #1140 (8d44fb3) into main (6aa1aef) will increase coverage by 0.93%. The diff coverage is 87.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 data Powered by Codecov. Last update 6aa1aef...8d44fb3. Read the comment docs.

codecov-commenter avatar Apr 21 '22 11:04 codecov-commenter