Skip to content

Allow empty PATH_INFO.#2214

Merged
ioquatix merged 1 commit intorack:mainfrom
socketry:path_info-empty-string
Jun 17, 2024
Merged

Allow empty PATH_INFO.#2214
ioquatix merged 1 commit intorack:mainfrom
socketry:path_info-empty-string

Conversation

@ioquatix
Copy link
Copy Markdown
Member

@ioquatix ioquatix commented Jun 17, 2024

From https://datatracker.ietf.org/doc/html/rfc3875#section-4.1.5:

The PATH_INFO variable specifies a path to be interpreted by the CGI
script. It identifies the resource or sub-resource to be returned by
the CGI script, and is derived from the portion of the URI path
hierarchy following the part that identifies the script itself.
Unlike a URI path, the PATH_INFO is not URL-encoded, and cannot
contain path-segment parameters. A PATH_INFO of "/" represents a
single void path segment.

      PATH_INFO = "" | ( "/" path )
      path      = lsegment *( "/" lsegment )
      lsegment  = *lchar
      lchar     = <any TEXT or CTL except "/">

Our interpretation of PATH_INFO is more extensive than the CGI specification to allow for things like OPTIONS * and CONNECT host:port style requests.

@ioquatix
Copy link
Copy Markdown
Member Author

@jeremyevans @simi I think once this is merged, #2210 will be green.

@ioquatix ioquatix merged commit c90ffc6 into rack:main Jun 17, 2024
@ioquatix
Copy link
Copy Markdown
Member Author

@jeremyevans if this is breaking Sinatra, I'd like to backport, as our interpretation of the RFC was incorrect, so this should be a bug.

@ioquatix ioquatix deleted the path_info-empty-string branch June 17, 2024 14:19
@jeremyevans
Copy link
Copy Markdown
Contributor

Backporting to 3.1 is fine.

simi pushed a commit to RubyElders/rack that referenced this pull request Jun 17, 2024
dentarg pushed a commit to dentarg/rack that referenced this pull request Jul 10, 2024
ioquatix added a commit that referenced this pull request Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants