Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport 2104 3-0-stable #2164

Merged
merged 1 commit into from
Mar 20, 2024

Commits on Mar 20, 2024

  1. Backport rack#2104 to 3-0-stable

    Return empty when parsing a multi-part POST with only one end delimiter.
    
    Fixed: rack#2103
    
    Sending the following request in a browser generates a request with
    with only one end delimiter.
    
    ```javascript
    const formData = new FormData();
    const request = new Request('http://127.0.0.1:8080/', {
      method: 'POST',
      body: formData,
    });
    const response = fetch(request);
    ```
    
    ```
    curl 'http://127.0.0.1:8080/' \
      -H 'Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryR1LC4tR6ayskIXJm' \
      --data-raw $'------WebKitFormBoundaryR1LC4tR6ayskIXJm--\r\n'
    ```
    
    This request is not compliant RFC7578, but is generated by major browsers such as
    FireFox and Chrome.
    Supporting this request will cause the multipart parser to return an empty value.
    alpaca-tc authored and JoeDupuis committed Mar 20, 2024
    Configuration menu
    Copy the full SHA
    47351c9 View commit details
    Browse the repository at this point in the history