 			fatalError("failed to find task info for import file")
 		}
 		defer { tasks.removeValue(forKey: index) }
-		// swiftlint:disable:next force_cast
-		let httpResponse = task.response as! HTTPURLResponse
+		guard let httpResponse = task.response?.httpResponse else { fatalError("impossible") }
 		Log.info("upload status=\(httpResponse.statusCode)", .network)
 		guard httpResponse.statusCode == 201 else {
 			progressObserver?.send(error: Rc2Error(type: .network, nested: NetworkingError.invalidHttpStatusCode(httpResponse)))

		for (index, aFileToImport) in files.enumerated() {
			let srcUrl = tmpDir.appendingPathComponent(aFileToImport.actualFileName)
			do {
				try fileManager.linkItem(at: aFileToImport.fileUrl, to: srcUrl)
			} catch {
				Log.error("failed to create link for upload: \(error)", .network)
				return ProgressSignalProducer(error: Rc2Error(type: .file, nested: error, explanation: ""))
			}
			let destUrl = URL(string: "\(conInfo.host.urlPrefix)/file/\(workspace.wspaceId)", relativeTo: baseUrl)!
			var request = URLRequest(url: destUrl)
			request.httpMethod = "POST"

			defer {
				importedFileIds.insert(rawFile.id)
			}
			// store the original file in the cache so it isn't immediately downloaded
			let fileData = try Data(contentsOf: importData.srcFile)
			//is this really the best way to handle this error? oberver might have been set to nil
			fileCache.cache(file: rawFile, withData: fileData).startWithFailed { updateError in
