⬆️ Update dependency hono to v3.11.7 [SECURITY] #45
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
3.2.7
->3.11.7
GitHub Vulnerability Alerts
CVE-2023-50710
Impact
The clients may override named path parameter values from previous requests if the application is using TrieRouter. So, there is a risk that a privileged user may use unintended parameters when deleting REST API resources.
TrieRouter is used either explicitly or when the application matches a pattern that is not supported by the default RegExpRouter.
The code to reproduce it. The server side application:
The client code which makes requests to the server application:
The results:
Patches
"v3.11.7" includes the change to fix this issue.
Workarounds
Don't use TrieRouter directly.
References
Router options on the Hono website: https://hono.dev/api/hono#router-option
Release Notes
honojs/hono (hono)
v3.11.7
Compare Source
Security Update
This release includes a security patch that fixes the vulnerability in TrieRouter.
If you are using the default preset or
hono/quick
, or specifying the router asTrieRouter
, you must upgrade to this version3.11.7
immediately.How to upgrade
For Deno
Just increment the version specifier to
v3.11.7
.For Node.js
Upgrade the
hono
package via npm:You may not update the
hono
package withnpm update
, so please usenpm install
.The vulnerability detail
The clients may override named path parameter values from previous requests if the application is using TrieRouter. So, there is a risk that a privileged user may use unintended parameters when deleting REST API resources.
TrieRouter is used either explicitly or when the application matches a pattern that is not supported by the default RegExpRouter.
The advisory: GHSA-f6gv-hh8j-q8vq
Our Approach to Security
If you discover such a vulnerability, please contact us immediately. We will respond immediately; we have enabled GitHub's private vulnerability reporting feature, so please use that.
https://github.com/honojs/hono/security/advisories
Thanks.
Full Changelog: honojs/hono@v3.11.6...v3.11.7
v3.11.6
Compare Source
What's Changed
status
correctly by @yusukebe in https://github.com/honojs/hono/pull/1814Full Changelog: honojs/hono@v3.11.5...v3.11.6
v3.11.5
Compare Source
What's Changed
hono/tiny
size by @ryuapp in https://github.com/honojs/hono/pull/1809c.json()
allows object and returns JSONParsed by @yusukebe in https://github.com/honojs/hono/pull/1806New Contributors
Full Changelog: honojs/hono@v3.11.4...v3.11.5
v3.11.4
Compare Source
What's Changed
c.json()
supportsundefined
/null
response by @yusukebe in https://github.com/honojs/hono/pull/1794Full Changelog: honojs/hono@v3.11.3...v3.11.4
v3.11.3
Compare Source
What's Changed
private _basePath
instead of#basePath
by @yusukebe in https://github.com/honojs/hono/pull/1785ClientResponse.json()
returns Union correctly by @yusukebe in https://github.com/honojs/hono/pull/1786New Contributors
Full Changelog: honojs/hono@v3.11.2...v3.11.3
v3.11.2
Compare Source
What's Changed
E
env type argument toshowRoutes
&inspectRoutes
hono
parameter by @NuroDev in https://github.com/honojs/hono/pull/1778New Contributors
Full Changelog: honojs/hono@v3.11.1...v3.11.2
v3.11.1
Compare Source
What's Changed
c.json()
by @yusukebe in https://github.com/honojs/hono/pull/1776Full Changelog: honojs/hono@v3.11.0...v3.11.1
v3.11.0
Compare Source
Hono v3.11.0 is now available! Let's take a look at the new features.
ErrorBoundary
This release introduces the new JSX component
ErrorBoundary
. It allows you to catch errors in child components.For instance, in the example below, it will display the content specified in
fallback
if an error occurs.ErrorBoundary
can be used with asynchronous components andSuspense
as well.Thanks to @usualoma!
createFactory()
andcreateHandlers()
The Factory helper now provides
createFactory()
, which creates an instance of the Factory class.createHandlers()
in a Factory class instance assists in defining handlers.Dev Helper
Dev Helper is now available.
Instead of using
app.showRoutes()
, theshowRoutes()
function exported fromhono/dev
will display the registered routes in your console.Consider an application like the following:
When this application starts, the routes will be displayed in your console as follows:
Thanks to @usualoma!
app.showRoutes
has been deprecated.c.json()
supports RPCc.json()
now supports RPC, meaning you no longer need to usec.jsonT()
for RPC-mode.c.jsonT()
has been deprecated.Thanks to @usualoma!
c.req.routePath
You can retrieve the registered path within the handler as shown below:
If you access
/posts/123
, it will return/posts/:id
:Thanks to @usualoma!
Other new features
All Updates
ErrorBoundary
component by @usualoma in https://github.com/honojs/hono/pull/1714createFactory()
andcreateHandlers()
by @yusukebe in https://github.com/honojs/hono/pull/1743experimental
fromc.render
/c.setRenderer()
by @yusukebe in https://github.com/honojs/hono/pull/1748bearerAuth
to accept a list of token strings by @mstibbard in https://github.com/honojs/hono/pull/1749inspectRoutes()
andshowRoutes()
by @usualoma in https://github.com/honojs/hono/pull/1716Env
types with changed routes by @yusukebe in https://github.com/honojs/hono/pull/1757MESSAGE_MATCHER_IS_ALREADY_BUILT
by @yusukebe in https://github.com/honojs/hono/pull/1763c.json()
have a type equivalent toc.jsonT()
by @usualoma in https://github.com/honojs/hono/pull/1728matchedRoutes
androutePath
forHonoRequest
by @usualoma in https://github.com/honojs/hono/pull/1744ErrorBoundary
asexperimental
by @yusukebe in https://github.com/honojs/hono/pull/1771createHandlers
by @yusukebe in https://github.com/honojs/hono/pull/1772#
for private properties by @yusukebe in https://github.com/honojs/hono/pull/1762New Contributors
Full Changelog: honojs/hono@v3.10.5...v3.11.0
v3.10.5
Compare Source
What's Changed
Full Changelog: honojs/hono@v3.10.4...v3.10.5
v3.10.4
Compare Source
What's Changed
content-type
withc.text()
correctly by @yusukebe in https://github.com/honojs/hono/pull/1761Full Changelog: honojs/hono@v3.10.3...v3.10.4
v3.10.3
Compare Source
What's Changed
jest.config.js
by @yusukebe in https://github.com/honojs/hono/pull/1731Path=/
forsetCookie()
/setSignedCookie()
by @yusukebe in https://github.com/honojs/hono/pull/1742New Contributors
Full Changelog: honojs/hono@v3.10.2...v3.10.3
v3.10.2
Compare Source
What's Changed
compute@edge
tocompute
by @yusukebe in https://github.com/honojs/hono/pull/1708onError()
handler to be async by @yusukebe in https://github.com/honojs/hono/pull/1730New Contributors
Full Changelog: honojs/hono@v3.10.1...v3.10.2
v3.10.1
Compare Source
What's Changed
c.text()
set the status set byc.status()
by @yusukebe in https://github.com/honojs/hono/pull/1702Full Changelog: honojs/hono@v3.10.0...v3.10.1
v3.10.0
Compare Source
Hono v3.10.0 is now available! Let's explore the new features.
Support for Async Components in JSX
Hono's JSX now supports Async Components. You can use
async
/await
in your components.Thanks, @usualoma!
Introduction of
Suspense
andrenderToReadableStream()
With the Async Component, as shown above, it will await until
fetch
is completed. But now, if you want to render HTML before that, you can useSuspense
.When you use
Suspense
withrenderToReadableStream()
, it initially renders the content infallback
. After the Promise in Suspense is resolved, the real content is rendered.If you make
Component
sleep for 2 seconds, the result will be as follows:Area.mp4
Thanks, @usualoma!
JSX Renderer Middleware Now Supports
stream
The JSX Renderer Middleware now supports
stream
, allowing you to useSuspense
with it. You can return streaming responses withoutrenderToReadableStream()
and without writing header values such asTransfer-Encoding: chunked
.Thanks, @usualoma!
AWS Lambda Adapter Now Supports Streaming Response
The
streamHandle
is now available in the AWS Lambda adapter. With this, AWS Lambda can handle streaming responses.Thanks, @watany-dev!
Support
@jsx precompile
for DenoNow, Hono's JSX supports the
precompile
feature for Deno. To enable it, write deno.json as follows.Thanks, @usualoma!
Ecosystem
The ecosystem is evolving. Today, we introduce one framework using Hono.
All Updates
Suspense
anduse
. by @usualoma in https://github.com/honojs/hono/pull/1630@experimental
fromcreateMiddleware()
by @yusukebe in https://github.com/honojs/hono/pull/1653Compute@Edge
toCompute
by @yusukebe in https://github.com/honojs/hono/pull/1664experimental
flag fromapp.mount()
by @yusukebe in https://github.com/honojs/hono/pull/1669ContextVariableMap
forc.var
by @yusukebe in https://github.com/honojs/hono/pull/1682console.error()
for defaulterrorHandler
by @yusukebe in https://github.com/honojs/hono/pull/1687New Contributors
Full Changelog: honojs/hono@v3.9.2...v3.10.0
v3.9.2
Compare Source
Security Update for Windows
This release includes a security patch that fixes the vulnerability for
serveStatic
on Windows OS. If you run a Hono app on Windows with Deno or Node.js, you must upgrade to this version3.9.2
immediately.Note: You don't need upgrade it right now if you run it on Cloudflare, Deno on Linux/Unix/macOS, Deno Deploy, Bun, or Node.js on Linux/Unix/macOS.
How to upgrade
For Deno
Just increment the version specifier to
v3.9.2
.For Node.js
Upgrade the
hono
package via npm:You may not update the
hono
package withnpm update
, so please usenpm install
.Our Approach to Security
If you discover such a vulnerability, please contact us immediately. We will respond immediately; we have enabled GitHub's private vulnerability reporting feature, so please use that.
https://github.com/honojs/hono/security/advisories
Thanks.
What's Changed
Full Changelog: honojs/hono@v3.9.1...v3.9.2
v3.9.1
Compare Source
What's Changed
package.json
): export types correctly by @yusukebe in https://github.com/honojs/hono/pull/1633Full Changelog: honojs/hono@v3.9.0...v3.9.1
v3.9.0
Compare Source
Release Notes
Hono v3.9.0 is out now! Let's take a look at what's new.
Improving the Developer Experience for JSX
Now we have the types for JSX.
Type definitions for JSX intrinsic elements are available. So, you can write your JSX with type annotation.
You can also override the definitions to add your custom elements and attributes.
Clerk Middleware
Now Clerk Middleware is available! You can use Clerk for authentication in your application.
Thanks @octoper!
New Starter Template for Cloudflare Pages
The Cloudflare Pages starter template is now Vite-based! You can develop truly full-stack applications quickly and fast thanks to Vite's HMR.
It uses Hono's original dev-server provided by @hono/vite-dev-server. And uses @hono/vite-cloudflare-pages for building the application. The config file is very neat.
You can use it with the
create hono
command:Ecosystem
The ecosystem has evolved. We introduce two products for Hono and one framework using Hono. Try them!
All Updates
runtime
option toenv
by @yusukebe in https://github.com/honojs/hono/pull/1622docType
option by @yusukebe in https://github.com/honojs/hono/pull/1621v3.8.4
Compare Source
What's Changed
New Contributors
Full Changelog: honojs/hono@v3.8.3...v3.8.4
v3.8.3
Compare Source
What's Changed
PropsForRenderer
by @yusukebe in https://github.com/honojs/hono/pull/1607Full Changelog: honojs/hono@v3.8.2...v3.8.3
v3.8.2
Compare Source
What's Changed
FetchEvent
detection way by @yusukebe in https://github.com/honojs/hono/pull/1595hono-base
by @yusukebe in https://github.com/honojs/hono/pull/1604New Contributors
Full Changelog: honojs/hono@v3.8.1...v3.8.2
v3.8.1
Compare Source
What's Changed
c.req.params()
in nested app with custom error handler. by @usualoma in https://github.com/honojs/hono/pull/1593Full Changelog: honojs/hono@v3.8.0...v3.8.1
v3.8.0
Compare Source
Hono v3.8.0 is out now! Let's take a look at the new features.
JSX Context API
The new feature for JSX. By using
useContext()
, you can share data globally across any level of the Component tree without passing values through props.Thanks @usualoma!
JSX Renderer Middleware
JSX Renderer Middleware allows you to set up the layout when rendering JSX with the
c.render()
function, without the need for usingc.setRenderer()
. Additionally, it enables access to instances of Context within components through the use ofuseRequestContext()
.Thanks @usualoma!
Streaming Helper
The streaming Helper provides a method to extend
c.stream()
.streamSSE()
allows you to stream Server-Sent Events (SSE) seamlessly.Thanks @watany-dev!
Factory Helper
The Factory Helper provides useful functions for creating Hono's components such as Middleware. Sometimes it's difficult to set the proper TypeScript types, but this helper facilitates that.
createMiddleware()
that is added this version will create your custom middleware.Thanks @arunavabasu-03 for helping!
parseBody()
supports multi valuesNow,
c.req.parseBody()
supports multi values.If the key is
foo[]
, it will be(string | File)[]
.And, you can use the
all
option.Thanks @sor4chi!
Improve path matching in the router
Improved the path matching in the router. Previously, for instance, a
Duplicate param name
error would be thrown if there were parameters with the same name,type
,url
, as shown below:With this improvement, the error is no longer thrown, and the correct parameter values can be obtained in each handler.
Thanks @usualoma!
All Updates
parseBody()
for multi values' field by @sor4chi in https://github.com/honojs/hono/pull/1528params
per a handler (optimized for RegExpRouter) by @usualoma in https://github.com/honojs/hono/pull/1566basePath
option for the constructor, deprecateapp.basePath()
by @yusukebe in https://github.com/honojs/hono/pull/1560package.json
): exportstreaming
helper by @yusukebe in https://github.com/honojs/hono/pull/1578factory
helper for Deno by @yusukebe in https://github.com/honojs/hono/pull/1582basePath
option for the constructor, deprecateapp.basePath()
(#1560)" by @yusukebe in https://github.com/honojs/hono/pull/1586hono-base
by @yusukebe in https://github.com/honojs/hono/pull/1588New Contributors
Full Changelog: honojs/hono@v3.7.6...v3.8.0
v3.7.6
Compare Source
What's Changed
instanceOf
by @yusukebe in https://github.com/honojs/hono/pull/1565New Contributors
Full Changelog: honojs/hono@v3.7.5...v3.7.6
v3.7.5
Compare Source
What's Changed
Full Changelog: honojs/hono@v3.7.4...v3.7.5
v3.7.4
Compare Source
What's Changed
FetchEvent
instead ofFetchEventLike
by @yusukebe in https://github.com/honojs/hono/pull/1532any
casting by @yusukebe in https://github.com/honojs/hono/pull/1535Fragment
correctly by @yusukebe in https://github.com/honojs/hono/pull/1541Full Changelog: honojs/hono@v3.7.3...v3.7.4
v3.7.3
Compare Source
What's Changed
Full Changelog: honojs/hono@v3.7.2...v3.7.3
v3.7.2
Compare Source
What's Changed
bufferToFormData()
by @yusukebe in https://github.com/honojs/hono/pull/1500Full Changelog: honojs/hono@v3.7.1...v3.7.2
v3.7.1
Compare Source
What's Changed
testing
helper by @yusukebe in https://github.com/honojs/hono/pull/1493Full Changelog: honojs/hono@v3.7.0...v3.7.1
v3.7.0
Compare Source
Hono v3.7.0 is out now! Let's take a look at the new features.
c.stream()
andc.streamText()
We added the awaited functionality related to streaming.
c.stream()
andc.streamText()
.You can easily create HTTP Streaming endpoints with them.
You know Streaming works well with AI. With
streamText()
you can write your ChatGPT Gateway in elegant code.This application can display streamed data from OpenAI's API in a flowing manner.
Screen.Recording.2023-09-21.at.11.11.36.mov
Thanks, @sor4chi and @geelen !
Testing Helper
With
testClient
in Testing Helper you can easily write your tests. The object returned by this function is thehc
client, so you can define your request with the editor completion.sc.mov
Thanks, @hagishi !
JWT helper
We uses JWT functions internally, but now they are exported as JWT Helper. You can import and use them.
Thanks, @julianpoma !
All Updates
enum
by @yusukebe in https://github.com/honojs/hono/pull/1485c.stream()
andc.streamText()
matters by @yusukebe in https://github.com/honojs/hono/pull/1482New Contributors
Full Changelog: honojs/hono@v3.6.3...v3.7.0
v3.6.3
Compare Source
What's Changed
jsonT()
should be union by @yusukebe in https://github.com/honojs/hono/pull/1471Full Changelog: honojs/hono@v3.6.2...v3.6.3
v3.6.2
Compare Source
What's Changed
string
by @yusukebe in https://github.com/honojs/hono/pull/1470New Contributors
Full Changelog: honojs/hono@v3.6.1...v3.6.2
v3.6.1
Compare Source
This release includes tiny features and bug fixes.
What's Changed
deprecate
should bedeprecated
by @yusukebe in https://github.com/honojs/hono/pull/1448