-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
Description
| Previous ID | SR-8759 |
| Radar | None |
| Original Reporter | @norio-nomura |
| Type | Bug |
| Status | Resolved |
| Resolution | Done |
Attachment: Download
Environment
swift-4.2-DEVELOPMENT-SNAPSHOT-2018-09-07-a or later on Linux
Additional Detail from JIRA
| Votes | 0 |
| Component/s | Foundation |
| Labels | Bug |
| Assignee | None |
| Priority | Medium |
md5: aa18d826eb92d2c55d1554ebd6caceb4
Issue Description:
Reproducing steps
-
docker run -it --rm norionomura/swift:4220180907a
log:
$ docker run -it --rm norionomura/swift:4220180907a
root@a6b6631911aa:/# curl -s https://gist.githubusercontent.com/norio-nomura/73c3a12db6a9d615e239954259ff89cf/raw/00b4351496c153e13af0a2674bb8fe75e661a70f/httpBodyIsNotSentToTheDomainThatReceivedCookie.swift|swift -
request.httpBody: Optional(15 bytes)
postTask.originalRequest.httpBody: nil
-- response body begin
{
"args": {},
"data": "",
"files": {},
"form": {},
"headers": {
"Accept": "*/*",
"Accept-Encoding": "deflate, gzip",
"Accept-Language": "en",
"Connection": "close",
"Content-Length": "0",
"Content-Type": "application/json",
"Cookie": "freeform=test",
"Host": "httpbin.org",
"User-Agent": "swift (unknown version) curl/7.47.0"
},
"json": null,
"origin": "180.196.246.165",
"url": "http://httpbin.org/post"
}
-- response body endpostTask.originalRequest.httpBody: nil indicates httpBody is lost.
Response body indicates {{httpBody is not received on http://httpbin.org/post.
Until swift-4.2-DEVELOPMENT-SNAPSHOT-2018-08-25-a, it works as expected.
$ docker run -it --rm norionomura/swift:4220180825a
root@452e49dbf55d:/# curl -s https://gist.githubusercontent.com/norio-nomura/73c3a12db6a9d615e239954259ff89cf/raw/00b4351496c153e13af0a2674bb8fe75e661a70f/httpBodyIsNotSentToTheDomainThatReceivedCookie.swift|swift -
request.httpBody: Optional(15 bytes)
postTask.originalRequest.httpBody: Optional(15 bytes)
-- response body begin
{
"args": {},
"data": "{\"key\":\"value\"}",
"files": {},
"form": {},
"headers": {
"Accept": "*/*",
"Accept-Encoding": "deflate, gzip",
"Accept-Language": "en",
"Connection": "close",
"Content-Length": "15",
"Content-Type": "application/json",
"Host": "httpbin.org",
"User-Agent": "swift (unknown version) curl/7.47.0"
},
"json": {
"key": "value"
},
"origin": "180.196.246.165",
"url": "http://httpbin.org/post"
}
-- response body endpostTask.originalRequest.httpBody: Optional(15 bytes) indicates that httpBody is passed to URLSessionDataTask.
It succeeded to post httpBody to http://httpbin.org/post.
swift-4.2-branch branch is affected by this issue.
master branch is not affected by this issue.
Reactions are currently unavailable