Sha256: 33d158f937cc09739cb2fcb9a86cb62bbbcc2b69ec55916bdfebb5a97ab8575f

Contents?: true

Size: 505 Bytes

Versions: 11

Compression:

Stored size: 505 Bytes

Contents

class CustomResponseController < ApplicationController
  skip_before_action :verify_authenticity_token

  def make_response
    response_args_json = params[:response]
    raise ActionController::BadRequest unless response_args_json

    (response_args_json[:headers] || {}).each do |name, value|
      response.headers[name] = value
    end

    render inline: response_args_json[:body],
           status: response_args_json[:status],
           content_type: response_args_json[:content_type]
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
wovnrb-3.11.1 docker/rails/TestSite/app/controllers/custom_response_controller.rb
wovnrb-3.11.0 docker/rails/TestSite/app/controllers/custom_response_controller.rb
wovnrb-3.10.3 docker/rails/TestSite/app/controllers/custom_response_controller.rb
wovnrb-3.10.2 docker/rails/TestSite/app/controllers/custom_response_controller.rb
wovnrb-3.10.1 docker/rails/TestSite/app/controllers/custom_response_controller.rb
wovnrb-3.10.0 docker/rails/TestSite/app/controllers/custom_response_controller.rb
wovnrb-3.9.0 docker/rails/TestSite/app/controllers/custom_response_controller.rb
wovnrb-3.8.0 docker/rails/TestSite/app/controllers/custom_response_controller.rb
wovnrb-3.7.2 docker/rails/TestSite/app/controllers/custom_response_controller.rb
wovnrb-3.7.1 docker/rails/TestSite/app/controllers/custom_response_controller.rb
wovnrb-3.6.0 docker/rails/TestSite/app/controllers/custom_response_controller.rb