-
Notifications
You must be signed in to change notification settings - Fork 718
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix digest auth http: ContentLength=xxx with Body length 0 #730
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@icepie Can you please add unit test cases?
Ok! I have added d3026f9 old codeRunning tool: /home/icepie/.go/bin/go test -timeout 30s -run ^TestRequestDigestAuthWithBody$ github.com/go-resty/resty/v2
--- FAIL: TestRequestDigestAuthWithBody (0.00s)
/home/icepie/Projects/resty-fix/resty_test.go:690: Method: POST
/home/icepie/Projects/resty-fix/resty_test.go:691: Path: /dir/index.html
/home/icepie/Projects/resty-fix/resty_test.go:690: Method: POST
/home/icepie/Projects/resty-fix/resty_test.go:691: Path: /dir/index.html
/home/icepie/Projects/resty-fix/resty_test.go:828: Error occurred [Post "http://127.0.0.1:40125/dir/index.html": net/http: HTTP/1.x transport connection broken: http: ContentLength=41 with Body length 0]
/home/icepie/Projects/resty-fix/resty_test.go:842: Expected [200], got [0]
/home/icepie/Projects/resty-fix/request_test.go:740: Result Success: &{"" ""}
/home/icepie/Projects/resty-fix/resty_test.go:877: Response Status:
/home/icepie/Projects/resty-fix/resty_test.go:878: Response Time: 353.067µs
/home/icepie/Projects/resty-fix/resty_test.go:879: Response Headers: map[]
/home/icepie/Projects/resty-fix/resty_test.go:880: Response Cookies: []
/home/icepie/Projects/resty-fix/resty_test.go:881: Response Body:
FAIL
FAIL github.com/go-resty/resty/v2 0.002s
FAIL new codeRunning tool: /home/icepie/.go/bin/go test -timeout 30s -run ^TestRequestDigestAuthWithBody$ github.com/go-resty/resty/v2
ok github.com/go-resty/resty/v2 (cached) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@icepie thanks for adding Test case
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## v2 #730 +/- ##
==========================================
- Coverage 96.62% 96.51% -0.11%
==========================================
Files 12 12
Lines 1630 1637 +7
==========================================
+ Hits 1575 1580 +5
- Misses 35 36 +1
- Partials 20 21 +1
☔ View full report in Codecov by Sentry. |
No description provided.