You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,6 +17,7 @@ error 405 do |env|
17
17
end
18
18
```
19
19
20
+
- Build the `Content-Disposition` of `send_file` per [RFC 6266](https://www.rfc-editor.org/rfc/rfc6266#section-4.3) and [RFC 8187](https://www.rfc-editor.org/rfc/rfc8187). The filename was dropped into the quoted-string as it was: a `"` in it ended the parameter early, a non-ASCII name went out raw where the parameter is defined as ASCII, and a control character made the standard library reject the header with a `500`. `"` and `\\` are now escaped, other characters outside printable ASCII become `_` in `filename`, and when that loses anything the original name follows as `filename*=UTF-8''…`, which user agents prefer. A plain ASCII name produces the same header as before. `Kemal::Utils.content_disposition` is the builder.
20
21
-`params.raw_body` returns the body of any request, not only a form or JSON one. It came back empty for `text/plain`, XML, or a request with no `Content-Type` at all, so such a body looked absent rather than unread; it is now read and cached the same way, under `max_request_body_size`. A `multipart/form-data` body is the one exception and still returns `""`, since `parse_files` streams it part by part. JSON detection now goes by media type instead of a string prefix: `application/vnd.api+json` and other `+json` types ([RFC 6839](https://www.rfc-editor.org/rfc/rfc6839)) parse into `params.json`, `Application/JSON` matches, and `application/jsonp` no longer does.
21
22
- Skip the WebSocket upgrade when a `before` filter has already answered. A `halt` in a `before_all` — an authentication check answering `401` — closed the response, and `Kemal::WebSocketHandler` went on to attempt the upgrade regardless; the standard library handler raised `IO::Error: Closed stream` on the closed response. The client had its `401`, but every rejected handshake was logged as a server error. The handler now returns once it finds the response closed.
22
23
- Stop confirming that a directory under `public/` exists when nothing is served for it. The standard library adds the trailing slash to a directory URL whenever its own `directory_listing` flag is on, and Kemal never set that flag from `serve_static`, so with `dir_listing` and `dir_index` both off `/admin` still answered `302 /admin/` while `/nope` answered `404` — the redirect was the only difference, and it told a scanner which directories are there. The redirect now happens only when a listing or an `index.html` would be served at the slashed URL; otherwise a directory falls through to the same `404` as a missing path.
0 commit comments