Spit out whitelist

This commit is contained in:
spengreb 2019-10-08 20:05:07 +02:00
parent 2a876d60e6
commit 028007c03a
2 changed files with 57 additions and 1 deletions

View file

@ -31,7 +31,7 @@ class VouchersController < ApplicationController
end
else
render json: "{ Voucher is not valid }", status: :unprocessable_entity
render json: `{ Voucher is not valid only #{whitelist} }`, status: :unprocessable_entity
end

View file

@ -1883,3 +1883,59 @@ TypeError (no implicit conversion of false into String):
app/controllers/vouchers_controller.rb:34:in `+'
app/controllers/vouchers_controller.rb:34:in `create'
Started POST "/vouchers?voucher=PromoStarr&vouchee=Scootzaar" for ::1 at 2019-10-08 20:04:11 +0200
Mysql2::Error::ConnectionError (Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)):
mysql2 (0.5.2) lib/mysql2/client.rb:90:in `connect'
mysql2 (0.5.2) lib/mysql2/client.rb:90:in `initialize'
activerecord (6.0.0) lib/active_record/connection_adapters/mysql2_adapter.rb:24:in `new'
activerecord (6.0.0) lib/active_record/connection_adapters/mysql2_adapter.rb:24:in `mysql2_connection'
activerecord (6.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:879:in `new_connection'
activerecord (6.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:923:in `checkout_new_connection'
activerecord (6.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:902:in `try_to_checkout_new_connection'
activerecord (6.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:863:in `acquire_connection'
activerecord (6.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:587:in `checkout'
activerecord (6.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:431:in `connection'
activerecord (6.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:1111:in `retrieve_connection'
activerecord (6.0.0) lib/active_record/connection_handling.rb:231:in `retrieve_connection'
activerecord (6.0.0) lib/active_record/connection_handling.rb:199:in `connection'
activerecord (6.0.0) lib/active_record/migration.rb:562:in `call'
actionpack (6.0.0) lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'
activesupport (6.0.0) lib/active_support/callbacks.rb:101:in `run_callbacks'
actionpack (6.0.0) lib/action_dispatch/middleware/callbacks.rb:26:in `call'
actionpack (6.0.0) lib/action_dispatch/middleware/executor.rb:14:in `call'
actionpack (6.0.0) lib/action_dispatch/middleware/actionable_exceptions.rb:17:in `call'
actionpack (6.0.0) lib/action_dispatch/middleware/debug_exceptions.rb:32:in `call'
actionpack (6.0.0) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
railties (6.0.0) lib/rails/rack/logger.rb:38:in `call_app'
railties (6.0.0) lib/rails/rack/logger.rb:26:in `block in call'
activesupport (6.0.0) lib/active_support/tagged_logging.rb:80:in `block in tagged'
activesupport (6.0.0) lib/active_support/tagged_logging.rb:28:in `tagged'
activesupport (6.0.0) lib/active_support/tagged_logging.rb:80:in `tagged'
railties (6.0.0) lib/rails/rack/logger.rb:26:in `call'
actionpack (6.0.0) lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
actionpack (6.0.0) lib/action_dispatch/middleware/request_id.rb:27:in `call'
rack (2.0.7) lib/rack/runtime.rb:22:in `call'
activesupport (6.0.0) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
actionpack (6.0.0) lib/action_dispatch/middleware/executor.rb:14:in `call'
actionpack (6.0.0) lib/action_dispatch/middleware/static.rb:126:in `call'
rack (2.0.7) lib/rack/sendfile.rb:111:in `call'
actionpack (6.0.0) lib/action_dispatch/middleware/host_authorization.rb:83:in `call'
rack-cors (1.0.3) lib/rack/cors.rb:95:in `call'
railties (6.0.0) lib/rails/engine.rb:526:in `call'
puma (3.12.1) lib/puma/configuration.rb:227:in `call'
puma (3.12.1) lib/puma/server.rb:660:in `handle_request'
puma (3.12.1) lib/puma/server.rb:474:in `process_client'
puma (3.12.1) lib/puma/server.rb:334:in `block in run'
puma (3.12.1) lib/puma/thread_pool.rb:135:in `block in spawn_thread'
Started POST "/vouchers?voucher=PromoStarr&vouchee=Scootzaar" for ::1 at 2019-10-08 20:04:27 +0200
 (3.2ms) SET @@SESSION.sql_mode = CONCAT(CONCAT(@@sql_mode, ',STRICT_ALL_TABLES'), ',NO_AUTO_VALUE_ON_ZERO'), @@SESSION.sql_auto_is_null = 0, @@SESSION.wait_timeout = 2147483
 (3.2ms) SELECT `schema_migrations`.`version` FROM `schema_migrations` ORDER BY `schema_migrations`.`version` ASC
Processing by VouchersController#create as HTML
Parameters: {"voucher"=>"PromoStarr", "vouchee"=>"Scootzaar"}
Voucher Exists? (0.3ms) SELECT 1 AS one FROM `vouchers` WHERE `vouchers`.`vouchee` = 'PromoStarr' LIMIT 1
↳ app/controllers/vouchers_controller.rb:23:in `create'
Completed 422 Unprocessable Entity in 132ms (Views: 0.2ms | ActiveRecord: 2.1ms | Allocations: 1850)