Skip to content

why i don't have full cookie if using ziti sdk #276

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

Open
Dicky019 opened this issue May 21, 2025 · 0 comments
Open

why i don't have full cookie if using ziti sdk #276

Dicky019 opened this issue May 21, 2025 · 0 comments

Comments

@Dicky019
Copy link

Dicky019 commented May 21, 2025

i am using simple example in https://github.com/openziti/ziti-sdk-swift/tree/main/cziti.sample-ios:

    urlSession.dataTask(with: urlReq) { (data, response, error) in
      guard error == nil else {
        self.setScrollableText(error!.localizedDescription)
        return
      }
      
      var docStr = ""
      if let response = response as? HTTPURLResponse {
        docStr += "Status: \(response.statusCode) " +
        "(\(HTTPURLResponse.localizedString(forStatusCode: response.statusCode)))\n" +
        response.allHeaderFields.compactMap {
          "\($0): \($1)\n"
        }.joined() + "\n"
      }
      
      if let data = data, let str = String(data: data, encoding: .utf8)  {
        docStr += "URL Req: \(urlReq.url?.absoluteString ?? "-")\n" + "URL Res: \(response?.url?.absoluteString ?? "-")\n" + "Authorization: Bearer \(token)\n\n"  + str
      } else {
        docStr += "...Unable to decode body to string..."
      }
      self.setScrollableText(docStr)
    }.resume()
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant