Sha256: 75991291d5e38be4fa8e75e0171a7d44ecf8ef0322a9199153a6fd654757199b

Contents?: true

Size: 506 Bytes

Versions: 7

Compression:

Stored size: 506 Bytes

Contents

class CustomResponseController < ApplicationController
  skip_before_action :verify_authenticity_token2

  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

7 entries across 7 versions & 1 rubygems

Version Path
wovnrb-3.5.0 docker/rails/TestSite/app/controllers/custom_response_controller.rb
wovnrb-3.4.1 docker/rails/TestSite/app/controllers/custom_response_controller.rb
wovnrb-3.4.0 docker/rails/TestSite/app/controllers/custom_response_controller.rb
wovnrb-3.3.1 docker/rails/TestSite/app/controllers/custom_response_controller.rb
wovnrb-3.2.0 docker/rails/TestSite/app/controllers/custom_response_controller.rb
wovnrb-3.1.0 docker/rails/TestSite/app/controllers/custom_response_controller.rb
wovnrb-3.0.3 docker/rails/TestSite/app/controllers/custom_response_controller.rb