{"action":"created","issue":{"url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/issues/1124","repository_url":"https://api.github.com/repos/couchbase/couchbase-lite-ios","labels_url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/issues/1124/labels{/name}","comments_url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/issues/1124/comments","events_url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/issues/1124/events","html_url":"https://github.com/couchbase/couchbase-lite-ios/issues/1124","id":134157692,"number":1124,"title":"Multipart Uploader cannot upload the attachment when using basic auth","user":{"login":"pasin","id":801454,"avatar_url":"https://avatars.githubusercontent.com/u/801454?v=3","gravatar_id":"","url":"https://api.github.com/users/pasin","html_url":"https://github.com/pasin","followers_url":"https://api.github.com/users/pasin/followers","following_url":"https://api.github.com/users/pasin/following{/other_user}","gists_url":"https://api.github.com/users/pasin/gists{/gist_id}","starred_url":"https://api.github.com/users/pasin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pasin/subscriptions","organizations_url":"https://api.github.com/users/pasin/orgs","repos_url":"https://api.github.com/users/pasin/repos","events_url":"https://api.github.com/users/pasin/events{/privacy}","received_events_url":"https://api.github.com/users/pasin/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/labels/backlog","name":"backlog","color":"ededed"},{"url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/labels/bug","name":"bug","color":"e11d21"},{"url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/labels/hotfix","name":"hotfix","color":"0052cc"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/milestones/15","html_url":"https://github.com/couchbase/couchbase-lite-ios/milestones/1.3","labels_url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/milestones/15/labels","id":1348000,"number":15,"title":"1.3","description":"","creator":{"login":"zgramana","id":759830,"avatar_url":"https://avatars.githubusercontent.com/u/759830?v=3","gravatar_id":"","url":"https://api.github.com/users/zgramana","html_url":"https://github.com/zgramana","followers_url":"https://api.github.com/users/zgramana/followers","following_url":"https://api.github.com/users/zgramana/following{/other_user}","gists_url":"https://api.github.com/users/zgramana/gists{/gist_id}","starred_url":"https://api.github.com/users/zgramana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zgramana/subscriptions","organizations_url":"https://api.github.com/users/zgramana/orgs","repos_url":"https://api.github.com/users/zgramana/repos","events_url":"https://api.github.com/users/zgramana/events{/privacy}","received_events_url":"https://api.github.com/users/zgramana/received_events","type":"User","site_admin":false},"open_issues":27,"closed_issues":15,"state":"open","created_at":"2015-10-09T22:24:58Z","updated_at":"2016-02-17T18:45:24Z","due_on":null,"closed_at":null},"comments":27,"created_at":"2016-02-17T02:23:03Z","updated_at":"2016-02-18T04:24:58Z","closed_at":null,"body":"I have noticed this while testing the tutorial app that uses basic authentication. I quickly wrote a unit test code to see the behavior (from the log, the CBLMultipartUploader cannot upload the attachment and will be eventually timeout). \r\n\r\n```\r\n- (void) test_24_BasicAuth_WithMultipartUpload {\r\n    [CBLManager enableLogging:@\"Sync\"];\r\n    [CBLManager enableLogging:@\"SyncVerbose\"];\r\n    [CBLManager enableLogging:@\"RemoteRequest\"];\r\n    [CBLManager enableLogging:@\"CBLRemoteRequest\"];\r\n    [CBLManager enableLogging:@\"CBLMultiStreamWriter\"];\r\n\r\n    NSURL* remoteDbURL = [self remoteTestDBURL: @\"cbl_auth_test\"];\r\n    if (!remoteDbURL)\r\n        return;\r\n\r\n    CBLDocument* doc = [db createDocument];\r\n    [doc putProperties:@{@\"foo\": @\"bar\"} error:nil];\r\n\r\n    NSInteger size = 500 * 1024;\r\n    unsigned char attachbytes[size];\r\n    for(int i=0; i<size; i++) {\r\n        attachbytes[i] = 1;\r\n    }\r\n    NSData* attach1 = [NSData dataWithBytes:attachbytes length:size];\r\n    CBLUnsavedRevision *rev2 = [doc.currentRevision createRevision];\r\n    [rev2 setAttachmentNamed: @\"attach\" withContentType: @\"text/plain\" content:attach1];\r\n    [rev2 save:nil];\r\n\r\n    CBLReplication* repl = [db createPushReplication: remoteDbURL];\r\n    repl.continuous = YES;\r\n    repl.authenticator = [CBLAuthenticator basicAuthenticatorWithName: @\"test\"\r\n                                                             password: @\"abc123\"];\r\n    [repl start];\r\n    while (YES) {\r\n        [[NSRunLoop currentRunLoop] runMode: NSDefaultRunLoopMode\r\n                                 beforeDate: [NSDate dateWithTimeIntervalSinceNow: 0.1]];\r\n    }\r\n}\r\n```\r\n\r\nLog:\r\nhttps://gist.github.com/pasin/558776d9e206d702c765#file-cbl-ios-issue-1024-error-log\r\n\r\nStop at:\r\n```\r\n8:21:28.330‖ CBLMultiStreamWriter: <CBLMultipartWriter: 0x60c000065380>: Received event 0x4\r\n18:21:28.330‖ CBLMultiStreamWriter: <CBLMultipartWriter: 0x60c000065380>:   Wrote 32768 (of 32768) bytes to _output (total 458752 of 512545)\r\n18:21:28.331‖ CBLMultiStreamWriter: <CBLMultipartWriter: 0x60c000065380>:   Refilling buffer\r\n18:21:28.331‖ CBLMultiStreamWriter: <CBLMultipartWriter: 0x60c000065380>:     read 32768 bytes from <__NSCFInputStream: 0x60d000057350>\r\n18:21:28.331‖ CBLMultiStreamWriter: <CBLMultipartWriter: 0x60c000065380>:   refilled buffer to 32768 bytes\r\n```"},"comment":{"url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/issues/comments/185537258","html_url":"https://github.com/couchbase/couchbase-lite-ios/issues/1124#issuecomment-185537258","issue_url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/issues/1124","id":185537258,"user":{"login":"pasin","id":801454,"avatar_url":"https://avatars.githubusercontent.com/u/801454?v=3","gravatar_id":"","url":"https://api.github.com/users/pasin","html_url":"https://github.com/pasin","followers_url":"https://api.github.com/users/pasin/followers","following_url":"https://api.github.com/users/pasin/following{/other_user}","gists_url":"https://api.github.com/users/pasin/gists{/gist_id}","starred_url":"https://api.github.com/users/pasin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pasin/subscriptions","organizations_url":"https://api.github.com/users/pasin/orgs","repos_url":"https://api.github.com/users/pasin/repos","events_url":"https://api.github.com/users/pasin/events{/privacy}","received_events_url":"https://api.github.com/users/pasin/received_events","type":"User","site_admin":false},"created_at":"2016-02-18T04:24:58Z","updated_at":"2016-02-18T04:24:58Z","body":"When I filtered the raw packets of sg1.2, I don't see any PUT requests shown up."}}