Git Product home page Git Product logo

Comments (5)

jaswope avatar jaswope commented on August 17, 2024

Hrmm, I don't see anything in there that signifies that this is a problem with rack-reverse-proxy. It looks like Rack::Cache is choking on a cache-control header, but I'm not sure where to point you for that.

from rack-reverse-proxy.

kbighorse avatar kbighorse commented on August 17, 2024

OK, that might be true, but I also have a problem when I try in development, here's my output:

https://gist.github.com/3790532

Here's my config/development.rb:

https://gist.github.com/3790540

from rack-reverse-proxy.

peterwald avatar peterwald commented on August 17, 2024

Turns out that all of the header values sent through reverse_proxy are wrapped in an array rather than a plain string. This breaks Rack::Cache further up the line.

{
 "content-type"=>["text/html; charset=UTF-8"],
 "connection"=>["keep-alive"],
 "keep-alive"=>["timeout=20"],
 "x-ua-compatible"=>["IE=Edge,chrome=1"],
 "x-cacheable"=>["SHORT"],
 "vary"=>["Accept-Encoding,Cookie"],
 "cache-control"=>["max-age=600, must-revalidate"],
 "x-cache"=>["HIT: 1"],
 "x-cache-group"=>["normal"],
 "x-type"=>["default"]
}

Rack::Cache is expecting the Cache-Control header to be "cache-control" => "max-age=600, must-revalidate" instead.

from rack-reverse-proxy.

kbighorse avatar kbighorse commented on August 17, 2024

So maybe I should submit a patch to Rack::Cache? or submit a patch to send a string arg from ReverseProxy?

from rack-reverse-proxy.

peterwald avatar peterwald commented on August 17, 2024

I submitted a pull request with my patch that fixes the issue for me. #25

AFAIK, the Rack interface expects headers to be strings. Returning them as an array is not expected.

from rack-reverse-proxy.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.