Code Monkey home page Code Monkey logo

Comments (5)

postmodern avatar postmodern commented on June 29, 2024

Although, I'm not sure if this should be added to Rack::MockResponse, or if it should be added at all. I suppose not adding a default Content-Type allows one to test whether an app is even specifying a custom Content-Type.

from rack-test.

brynary avatar brynary commented on June 29, 2024

Is a Content-Type header required by HTTP? I don't see anything saying it is.

If it's not required, I think rack-test should not handle it. (But, Sinatra, as a rack-test user, can default it to text/html because Sinatra is generally concerned with HTML).

Thoughts?

-Bryan

from rack-test.

nusco avatar nusco commented on June 29, 2024

HTTP doesn't require it in the general case, so I don't think rack-test should make any assumption about it. Even if HTTP did require it, I think rack-test shouldn't step forward and change it, because I might want to test my app for HTTP compliance, and I wouldn't want rack-test to give me false positives. In general, I want rack-test to give me exactly what the application-under-test would.

from rack-test.

postmodern avatar postmodern commented on June 29, 2024

This is fixed in rack edge, which has Rack::MockResponse inherit from Rack::Response, which properly handles headers with nil values. But it appears they still haven't released the new MockResponse in rack 1.2.2

from rack-test.

brynary avatar brynary commented on June 29, 2024

Closing for now, as it appears there's nothing actionable here. Please reopen if this is incorrect.

from rack-test.

Related Issues (20)

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.