Giter Club home page Giter Club logo

Comments (2)

steveruckdashel avatar steveruckdashel commented on June 29, 2024 1

Good question. There's 3 main approaches I could see.

  1. panic with a specific message. Doesn't help me any really.
  2. return an error. This would be a breaking change on a public function, so no-go.
  3. return nethttp.DefaultTransport without mutating ForceAttemptHTTP2 and DisableCompression.This is my preferred route. You would only hit this in cases where the conversion error happens today.
// GetDefaultTransport returns the default http transport used by the library
func GetDefaultTransport() nethttp.RoundTripper {
	defaultTransport, ok := nethttp.DefaultTransport.(*nethttp.Transport)
	if !ok {
		return nethttp.DefaultTransport
	}
	defaultTransport = defaultTransport.Clone()
	defaultTransport.ForceAttemptHTTP2 = true
	defaultTransport.DisableCompression = false
	return defaultTransport
}

I can open an PR if this seams alright to you.

from kiota-http-go.

baywet avatar baywet commented on June 29, 2024

Thanks for using kiota and for reporting this @steveruckdashel
If we changed that to a checked conversion instead, what would you expect to happen when it's false?

from kiota-http-go.

Related Issues (13)

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.