Skip to content

Add the QUERY method, use content-disposition 3, and fix redirect query strings and signed URLs

Latest

Choose a tag to compare

@github-actions github-actions released this 27 Nov 09:39
Immutable release. Only release title and notes can be modified.

9.4.0 (2026-11-27)

Features

  • The router supports the QUERY HTTP method (RFC 10008). Define a route with router.query(), and make its URL with urlFor.query() and signedUrlFor.query(). The router does not check the Content-Type of a QUERY request; @adonisjs/bodyparser 11.1 does. (#159)
  • response.attachment() uses content-disposition 3. A simple file name is no longer quoted, for example attachment; filename=hello.html. A name with non-ASCII characters also gets a filename* UTF-8 value. Both forms are valid under RFC 6266. (#162)

Bug fixes

  • A redirect to a URL that already has a query string merges the two query strings. withQs({ success: 1 }).toPath('/users?page=2') now redirects to /users?page=2&success=1. Before, it added a second ?. A key of the new query string replaces the same key of the URL, and a fragment stays at the end. This also fixes toIntended() of @adonisjs/session for an intended URL with a query string. (#160, closes #157)
  • request.hasValidSignature() accepts a signed URL with route params that are percent-encoded, for example { name: 'my invoice.pdf' } or { name: 'café' }. Before, the signature check failed for these URLs. (#155, closes #154)

Full changelog: v9.3.2...v9.4.0