lib/jets/internal/app/controllers/jets/rack_controller.rb in jets-1.0.18 vs lib/jets/internal/app/controllers/jets/rack_controller.rb in jets-1.1.0
- old
+ new
@@ -2,14 +2,24 @@
layout false
internal true
# Megamode
def process
- resp = rack_request
+ resp = mega_request
render(resp)
end
private
- def rack_request
- Jets::Rack::Request.new(event, self).process
+ # Override process! so it doesnt go through middleware adapter and hits
+ # process logic directly. This handles the case for AWS Lambda.
+ # For local server, we adjust the Middleware::Local logic.
+ def process!
+ status, headers, body = dispatch!
+ # Use the adapter only to convert the Rack triplet to a API Gateway hash structure
+ adapter = Jets::Controller::Rack::Adapter.new(event, context, meth)
+ adapter.convert_to_api_gateway(status, headers, body)
+ end
+
+ def mega_request
+ Jets::Mega::Request.new(event, self).proxy
end
end
\ No newline at end of file