rack-middleware Questions

4

Solved

I've written some Rack-Middleware and now I'm trying to test it with Rspec. But all Rack-Middleware is instantiated with an 'app' argument, that represents the Rails app itself. How do you guys moc...
Wormeaten asked 6/7, 2013 at 19:57

8

Solved

I have a middleware for announcing my application on the local network app using Bonjour, but it's also announcing the service when Rails is invoked from rake or through the console. I'd like to ...
Yonyona asked 22/11, 2012 at 6:1

2

Solved

Whenever sending malformed JSON against my API-only Rails 5.x application, I get an exception and Rails is returning the entire stack trace as JSON. Obviously I'd like to respond with a nicely, cus...
Disabled asked 26/10, 2016 at 16:57

4

Solved

I have a rails 4 app with middleware located at lib/some/middleware.rb which is currently injected into the stack though an initializer like so: MyApp::Application.configure.do |config| config.mi...
Osburn asked 1/1, 2014 at 23:8

1

I have installed rack-timeout gem and created rack_timeout.rb inside the initializers.I have set Rack::Timeout.service_timeout = 1 inside rack_timeout.rb.I want to restrict the rack-timeout to halt...
Rokach asked 23/11, 2016 at 12:47

0

I have a Ruby on Rails 4.2 multi-tenant application where I want each tenant to use it's own session cookie and cookie options. I tried different approaches but I can't get every detail right. To...

5

Solved

I often hear the term 'middleware' in the context of Ruby on Rails. What exactly is it? Can you provide specific examples?
Purehearted asked 9/7, 2010 at 23:10

4

I have a Rails 4 sample project (Blog) and I have created a simple middleware called 'request_timer' in config/initializers/request_timer.rb #config/initializers/request_timer.rb class RequestTi...
Diecious asked 22/1, 2014 at 21:3

2

Solved

I am trying to learn Middlewares and been practising how to mount it in the Rails application. I have followed the railscast So far I have implemented these steps: 1) Created a new Rails 4.2 appl...
Vedis asked 19/1, 2016 at 7:36

1

Solved

I'm trying to write some Rack Middleware for a Rails 4.2 app that alters the response body using the gsub method. I found older examples that use a pattern like this: class MyMiddleware def initi...
Annorah asked 10/4, 2015 at 15:9

2

Solved

For the latest version of Ruby on Rails (4 at the time of asking this question), what is the preferred way to implement code that modifies the request/response such as an authentication mechanism. ...

1

Solved

Recently I happened to see this word in Ruby code, use, when I was going through some code related to goliath, middleware etc. Looks like it is different from include/extend, and require. Can some...
Salyers asked 16/8, 2012 at 7:11

3

Solved

I want to set basic authentication for ActiveAdmin, which internal devise solution doesn't apply to my case. For that I would like to be able to add middleware to the ActiveAdmin Engine before this...
Phonogram asked 8/3, 2013 at 14:6

2

Solved

I am working on a event handler to report exceptions to a remote api (similar to newrelic agent) and I can not find a way to add my middleware to the rack without doing it in the environment.rb fil...
Electrometallurgy asked 17/12, 2013 at 9:17

1

Solved

In a Rack middleware filter, I know the call method takes an env hash variable. I'm looking through someone's Rack middleware code and I see env['HTTP_X_FORWARDED_HOST'] Can someone explain wha...
Eugenieeugenio asked 1/7, 2013 at 18:38

2

i want to try out a simple rack middleware "hello world", but i seem to get stuck. it looks like the main sytax changed, since some examples use this code: require 'rack/utils' class FooBar def...
Comminute asked 27/1, 2011 at 23:25
1

© 2022 - 2024 — McMap. All rights reserved.