Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-4216

Golang Http Clients Do Not Respect User Options

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.11.0
    • Go - Library
    • None

    Description

      As of 72ca60d, the instantiation of an http client with user-supplied options (NewTHttpClientWithOptions) disregards options.

      The target endpoint is tested with the following snippet:

      response, err := http.Get(urlstr)
      

      However, a user-supplied THttpClientOptions contains a client that should be used to test the endpoint instead, i.e.,

      response, err := options.Client.Get(urlstr)
      

      The user-supplied client may have settings that are required to communicate with the target endpoint.

      Though this fix seems simple, I have not supplied a patch, as this fix should likely be bundled with a greater overarching patch to THRIFT-4215. That is because the single line change above may not include all the fixes necessary to propagate client options correctly through the construction of a THttpTransport, and further errors are squelched.

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            dcelasun Duru Can Celasun
            jmrdi James Mouradian
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment