Class: Sinatra::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/sinatra_opal_patches.rb

Overview


  1. Response#calculate_content_length? (upstream base.rb:208)

Upstream returns true iff content-type is set, content-length is missing, and body is an Array. If any Array element is a native JS Promise (routes compiled ‘# await: true` return their body as a Promise until the adapter resolves it), computing bytesize would poison the response. Opt out in that case so Rack::Handler::CloudflareWorkers#build_js_response can await and set content-length downstream.