Git Product home page Git Product logo

Comments (4)

tomer-stripe avatar tomer-stripe commented on September 28, 2024

Hey @jcohenho! Could you share the headers you're seeing from the Stripe CLI?

from stripe-cli.

jcohenho avatar jcohenho commented on September 28, 2024

@tomer-stripe Here's an output from the request headers, note the HTTP_ACCEPT value:

(ruby@puma: cluster worker 2: 39111 [side_project]#39127) request.headers.to_h
{"rack.version"=>[1, 6],
 "rack.errors"=>#<IO:<STDERR>>,
 "rack.multithread"=>true,
 "rack.multiprocess"=>false,
 "rack.run_once"=>false,
 "rack.url_scheme"=>"http",
 "SCRIPT_NAME"=>"",
 "QUERY_STRING"=>"",
 "SERVER_PROTOCOL"=>"HTTP/1.1",
 "SERVER_SOFTWARE"=>"puma 5.6.4 Birdie's Version",
 "GATEWAY_INTERFACE"=>"CGI/1.2",
 "REQUEST_METHOD"=>"POST",
 "REQUEST_PATH"=>"/webhooks/stripe",
 "REQUEST_URI"=>"/webhooks/stripe",
 "HTTP_VERSION"=>"HTTP/1.1",
 "HTTP_HOST"=>"localhost:3000",
 "HTTP_USER_AGENT"=>"Stripe/1.0 (+https://stripe.com/docs/webhooks)",
 "CONTENT_LENGTH"=>"3107",
 "HTTP_ACCEPT"=>"*/*; q=0.5, application/xml",
 "HTTP_CACHE_CONTROL"=>"no-cache",
 "CONTENT_TYPE"=>"application/json; charset=utf-8",
 "HTTP_STRIPE_SIGNATURE"=>"redacted",
 "HTTP_ACCEPT_ENCODING"=>"gzip",
 "puma.request_body_wait"=>0,
 "SERVER_NAME"=>"localhost",
 "SERVER_PORT"=>"3000",
 "PATH_INFO"=>"/webhooks/stripe",
 "REMOTE_ADDR"=>"::1",
 "puma.socket"=>#<TCPSocket:fd 24, AF_INET6, ::1, 3000>,
 "rack.hijack?"=>true,
 "rack.hijack"=>#<Puma::Client:0xb220 @ready=true>,
 "rack.input"=>#<StringIO:0x000000010a685bu8>,
 "rack.after_reply"=>[],
 "puma.config"=>

from stripe-cli.

tomer-stripe avatar tomer-stripe commented on September 28, 2024

Thank you! Let me poke more. We mostly pass the headers through 1:1 so that's a little odd

for k, v := range headers {
req.Header.Add(k, v)
}
// add custom headers
for k, v := range c.headers {
if strings.ToLower(k) == "host" {
req.Host = v
} else {
req.Header.Add(k, v)
}
}

from stripe-cli.

tomer-stripe avatar tomer-stripe commented on September 28, 2024

@jcohenho Stripe itself is actually sending webhooks with that accept header. I confirmed that internally and with a test webhook: https://webhook.site/#!/view/6ffabbfa-a78d-4565-94ae-f6eec71f0718/8855e849-c425-4735-a629-bf7c2049e15b/1

I'm not sure if having the CLI change the behavior would be a good idea since this is how the data will be sent to you once you're in production too.

from stripe-cli.

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.