Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: sinatra/sinatra
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v4.1.1
Choose a base ref
...
head repository: sinatra/sinatra
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v4.2.1
Choose a head ref
  • 14 commits
  • 14 files changed
  • 8 contributors

Commits on Jan 29, 2025

  1. Avoid crash for integer values in content_type parameters (#2078)

    Here we ensure that `=~` is applicable by calling `to_s` before
    using it.
    
    Close #2077
    fbrusatti authored Jan 29, 2025
    Configuration menu
    Copy the full SHA
    c4b7c04 View commit details
    Browse the repository at this point in the history

Commits on Feb 9, 2025

  1. Fix malformed Content-Type headers (#2081)

    This commit ensures that all parameters of `Content-Type` are separated
    with commas (`,`) instead of semicolons (`;`).
    
    RFC 7231 (https://datatracker.ietf.org/doc/html/rfc7231#section-3.1.1.5) says:
    
          Content-Type = media-type
    
        Media types are defined in Section 3.1.1.1. An example of the field is
    
          Content-Type: text/html; charset=ISO-8859-4
    
    RFC 7231 3.1.1.1 (https://datatracker.ietf.org/doc/html/rfc7231#section-3.1.1.1) says:
    
        Media types define both a data format and various processing models:
        how to process that data in accordance with each context in which it
        is received.
    
          media-type = type "/" subtype *( OWS ";" OWS parameter )
          type       = token
          subtype    = token
    
        The type/subtype MAY be followed by parameters in the form of
        name=value pairs.
    
          parameter      = token "=" ( token / quoted-string )
    
        The type, subtype, and parameter name tokens are case-insensitive.
        Parameter values might or might not be case-sensitive, depending on
        the semantics of the parameter name.  The presence or absence of a
        parameter might be significant to the processing of a media-type,
        depending on its definition within the media type registry.
    
        A parameter value that matches the token production can be
        transmitted either as a token or within a quoted-string.  The quoted
        and unquoted values are equivalent.  For example, the following
        examples are all equivalent, but the first is preferred for
        consistency:
    
          text/html;charset=utf-8
          text/html;charset=UTF-8
          Text/HTML;Charset="utf-8"
          text/html; charset="utf-8"
    
    According to https://stackoverflow.com/a/35879320, it seems
    that there was prior confusion in early RFCs over this. It appears `,`
    was a mistake, and that `;` should always be used.
    
    Most people probably haven't run into this because in order to trigger
    this bug:
    
    1. The Sinatra app needs to insert a `;` in the call to `content_type`
    (such as `content_type "text/plain; version=0.0.4"`). If you omit the
    `;` in the `Content-Type`, then everything is fine.
    
    2. The client that talks to the app needs to reject `,` in the
    `Content-Type`. Golang's `mime.ParseMediaType` appears to reject
    `Content-Type` values that contain `,` but with the introduction of
    prometheus/prometheus#15136 Prometheus v3
    started to fail hard when this occurred.
    stanhu authored Feb 9, 2025
    Configuration menu
    Copy the full SHA
    025e8c5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c235249 View commit details
    Browse the repository at this point in the history

Commits on Mar 16, 2025

  1. CI: don't use Rack::Lint on invalid hostname (#2086)

    Due to better validation in Rack: rack/rack#2298
    
    See also
    
    - rack/rack#2295
    - rails/rails#54613
    dentarg authored Mar 16, 2025
    Configuration menu
    Copy the full SHA
    cfcc70d View commit details
    Browse the repository at this point in the history

Commits on Apr 21, 2025

  1. README: Remove duplicate mention of installing puma (#2091)

    The Readme has already been updated to require rackup and puma as hard
    dependencies (line 21). No need to also then recommend to install Puma
    on line 37.
    
    [ci skip]
    JonMidhir authored Apr 21, 2025
    Configuration menu
    Copy the full SHA
    ac3ff23 View commit details
    Browse the repository at this point in the history

Commits on Apr 22, 2025

  1. Set rubygems_mfa_required for the sinatra gem (#2087)

    It is already set to true for sinatra-contrib and rack-protection,
    happened in #1537
    dentarg authored Apr 22, 2025
    Configuration menu
    Copy the full SHA
    c918134 View commit details
    Browse the repository at this point in the history

Commits on Apr 25, 2025

  1. Add :static_headers setting for custom headers in static file respons…

    …es (#2089)
    
    This PR implements recent feature request related to static file
    responses. It introduces a new configuration setting, `:static_headers`,
    which allows developers to define custom headers that will be applied to
    all static file responses served by `static!` -method.
    
    Sinatra serves static files directly via `static!`, bypassing filters
    and middleware. This makes it so that there is no good ways to add
    headers like `Access-Control-Allow-Origin`, which are often needed for
    CORS access (e.g., when using fonts or images on canvas).
    
    Co-authored-by: Patrik Ragnarsson <[email protected]>
    otthe and dentarg authored Apr 25, 2025
    Configuration menu
    Copy the full SHA
    91cfb54 View commit details
    Browse the repository at this point in the history

Commits on May 23, 2025

  1. Sync changelog for v4.0.1

    zzak committed May 23, 2025
    Configuration menu
    Copy the full SHA
    5e15985 View commit details
    Browse the repository at this point in the history

Commits on Jul 30, 2025

  1. Skip broken tests. (#2115)

    This is a temporary fix for #2113 until rack/rack#2316 is merged.
    ioquatix authored Jul 30, 2025
    Configuration menu
    Copy the full SHA
    ea0d3fa View commit details
    Browse the repository at this point in the history

Commits on Aug 2, 2025

  1. PATH_INFO can never be empty. (#2114)

    Fixes #2113.
    ioquatix authored Aug 2, 2025
    Configuration menu
    Copy the full SHA
    fa99a21 View commit details
    Browse the repository at this point in the history

Commits on Oct 8, 2025

  1. Configuration menu
    Copy the full SHA
    3fe8c38 View commit details
    Browse the repository at this point in the history
  2. 4.2.0 release (#2122)

    dentarg authored Oct 8, 2025
    Configuration menu
    Copy the full SHA
    f2ad45f View commit details
    Browse the repository at this point in the history

Commits on Oct 10, 2025

  1. Revert "PATH_INFO can never be empty." (#2124)

    This reverts commit fa99a21.
    
    It causes problems, if you have an app like this
    
        class FooApp < Sinatra::Base
          get "/" do
            "hello foo"
          end
        end
    
    and map it like this in config.ru
    
        map("/foo") { run FooApp.new }
    
    `GET /foo` returns 404, which was not the case before. 
    `GET /foo/` does reach the app.
    
    Reported at #2113 (comment)
    dentarg authored Oct 10, 2025
    Configuration menu
    Copy the full SHA
    2c7f8db View commit details
    Browse the repository at this point in the history
  2. 4.2.1 release (#2125)

    dentarg authored Oct 10, 2025
    Configuration menu
    Copy the full SHA
    599a007 View commit details
    Browse the repository at this point in the history
Loading