syedmurtaza108 / chucker-flutter

An HTTP requests inspector inspired by Chucker Android
https://pub.dev/packages/chucker_flutter
MIT License
54 stars 32 forks source link

Fixed bug caused with accessing request.bodyFields when Content type is application/json #7

Closed Dammyololade closed 2 years ago

Dammyololade commented 2 years ago

Description

This PR is a fix for #https://github.com/syedmurtaza108/chucker-flutter/issues/6 which was caused by accessing request.bodyfields. Accessing bodyFields on request with content type other than application/x-www-form-urlencoded throws a state error. I hereby provided a fix for that with encoding the result of request.body

With this PR, it's ensured that request body with any content type can be accessed without throwing any error.

Type of Change

codecov-commenter commented 2 years ago

Codecov Report

Merging #7 (010af7d) into master (0d6fd28) will decrease coverage by 0.19%. The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master       #7      +/-   ##
==========================================
- Coverage   84.25%   84.05%   -0.20%     
==========================================
  Files          36       36              
  Lines        1264     1267       +3     
==========================================
  Hits         1065     1065              
- Misses        199      202       +3     
Impacted Files Coverage Ξ”
lib/src/http/chucker_http_client.dart 85.71% <0.00%> (-6.60%) :arrow_down:

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 c348f49...010af7d. Read the comment docs.