Giter Club home page Giter Club logo

Comments (3)

ganeshnj avatar ganeshnj commented on June 3, 2024 1

Hey @ambrusha, could you provide reproduction code to help us diagnose the issue?

from dd-sdk-ios.

ambrusha avatar ambrusha commented on June 3, 2024 1

Please take a look on this example
testDatadog.zip
I can not replicate the case when HTTPheaders become empty... but when I use po on breakpoint inside private func _intercept(task: URLSessionTask, additionalFirstPartyHosts: FirstPartyHosts?) you can see that on the line line of code task will get same requests...

As for my example, you can find that task.currentRequest?.url?.absoluteString and the string from created request are different and the difference is in last symbol /.

Also it's not a crasher, so if you have ability, please move it to appropriate place.
If you need more details, I'm happy to answer in a Datadog slack.

from dd-sdk-ios.

ganeshnj avatar ganeshnj commented on June 3, 2024

Thanks for sample code.

I see the issue with currentRequest and originalRequest

originalRequest

(lldb) po task.originalRequest
▿ Optional<URLRequest>
  ▿ some : https://docs.datadoghq.com
    ▿ url : Optional<URL>
      ▿ some : https://docs.datadoghq.com
        - _url : https://docs.datadoghq.com
    - cachePolicy : 0
    - timeoutInterval : 60.0
    - mainDocumentURL : nil
    - networkServiceType : __C.NSURLRequestNetworkServiceType
    - allowsCellularAccess : true
    ▿ httpMethod : Optional<String>
      - some : "GET"
    ▿ allHTTPHeaderFields : Optional<Dictionary<String, String>>
      - some : 0 elements
    - httpBody : nil
    - httpBodyStream : nil
    - httpShouldHandleCookies : true
    - httpShouldUsePipelining : false

currentRequest

(lldb) po task.currentRequest
▿ Optional<URLRequest>
  ▿ some : https://docs.datadoghq.com
    ▿ url : Optional<URL>
      ▿ some : https://docs.datadoghq.com
        - _url : https://docs.datadoghq.com
    - cachePolicy : 0
    - timeoutInterval : 60.0
    - mainDocumentURL : nil
    - networkServiceType : __C.NSURLRequestNetworkServiceType
    - allowsCellularAccess : true
    ▿ httpMethod : Optional<String>
      - some : "GET"
    ▿ allHTTPHeaderFields : Optional<Dictionary<String, String>>
      ▿ some : 12 elements
        ▿ 0 : 2 elements
          - key : "app-version"
          - value : "1.5"
        ▿ 1 : 2 elements
          - key : "device-screen-width"
          - value : "UIScreen.nativeWidth"
        ▿ 2 : 2 elements
          - key : "device-category"
          - value : "UIDevice.deviceCategory"
        ▿ 3 : 2 elements
          - key : "device-id"
          - value : "60ED20D8-640F-4732-A814-95E70A86127B"
        ▿ 4 : 2 elements
          - key : "device-screen-height"
          - value : "UIScreen.nativeHeight"
        ▿ 5 : 2 elements
          - key : "device-model"
          - value : "UIDevice.deviceModel"
        ▿ 6 : 2 elements
          - key : "x-api-key"
          - value : "ABC"
        ▿ 7 : 2 elements
          - key : "app-name"
          - value : "Unit-Tests"
        ▿ 8 : 2 elements
          - key : "x-access-token"
          - value : "Secret-A"
        ▿ 9 : 2 elements
          - key : "device-sdk"
          - value : "17.0"
        ▿ 10 : 2 elements
          - key : "device-os"
          - value : "UIDevice.deviceOS"
        ▿ 11 : 2 elements
          - key : "app-locale"
          - value : "self.appLocale"
    - httpBody : nil
    - httpBodyStream : nil
    - httpShouldHandleCookies : true
    - httpShouldUsePipelining : false

Headers applied at the NetworkClient instantiation are replaced with originalRequest which is bug here.

We should intercept the currentRequest.

from dd-sdk-ios.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.