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.
Snyk has created this PR to upgrade multiple dependencies.
👯♂ The following dependencies are linked and will therefore be updated together.ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.
@hono/node-server
from 1.11.0 to 1.12.1 | 7 versions ahead of your current version | a month ago
on 2024-08-19
hono
from 4.2.7 to 4.5.9 | 41 versions ahead of your current version | 22 days ago
on 2024-08-26
Issues fixed by the recommended upgrade:
SNYK-JS-HONO-7814167
Release notes
Package name: @hono/node-server
What's Changed
Full Changelog: v1.12.0...v1.12.1
What's Changed
New Contributors
Full Changelog: v1.11.5...v1.12.0
What's Changed
hono
as external to build by @ yusukebe in #182Full Changelog: v1.11.4...v1.11.5
What's Changed
New Contributors
Full Changelog: v1.11.3...v1.11.4
What's Changed
New Contributors
Full Changelog: v1.11.2...v1.11.3
What's Changed
New Contributors
Full Changelog: v1.11.1...v1.11.2
What's Changed
c.req.path
instead ofurl.pathname
by @ yusukebe in #166New Contributors
Full Changelog: v1.11.0...v1.11.1
What's Changed
Full Changelog: v1.10.1...v1.11.0
Package name: hono
What's Changed
NO_COLOR
by @ ryuapp in #3306type
(MIME) attribute types by @ ssssota in #3305Full Changelog: v4.5.8...v4.5.9
Security Fix for CSRF Protection Middleware
Before this release, in versions 4.5.7 and below, the CSRF Protection Middleware did not treat requests including
Content-Types
with uppercase letters (e.g.,Application/x-www-form-urlencoded
) as potential attacks, allowing them to pass.This could cause unexpected behavior, leading to a vulnerability. If you are using the CSRF Protection Middleware, please upgrade to version 4.5.8 or higher immediately.
For more details, see the report here: GHSA-rpfr-3m35-5vx5
What's Changed
target
andformtarget
attribute types by @ ssssota in #3299New Contributors
Full Changelog: v4.5.6...v4.5.7
What's Changed
New Contributors
Full Changelog: v4.5.5...v4.5.6
What's Changed
c.header
by @ nakasyou in #3221c.header
by @ nakasyou in #3255.
and not end/
by @ yusukebe in #3256Full Changelog: v4.5.4...v4.5.5
What's Changed
param
inValidationTargets
supports optional param by @ yusukebe in #3229New Contributors
Full Changelog: v4.5.3...v4.5.4
What's Changed
application/json
with a charset as JSON by @ yusukebe in #3199self.fetch
correctly by @ yusukebe in #3200New Contributors
Full Changelog: v4.5.2...v4.5.3
What's Changed
navigator
isundefined
by @ yusukebe in #3171navigator
isundefined
by @ yusukebe in #3173Full Changelog: v4.5.1...v4.5.2
What's Changed
@ experimental
fromcreateApp
by @ yusukebe in #3164query
inws
by @ yusukebe in #3169New Contributors
Full Changelog: v4.5.0...v4.5.1
Hono v4.5.0 is now available!
We have added three new built-in middleware. Now Hono is bringing 20 built-in middleware!
Amazing! These truly make Hono batteries-included framework.
Let's go through the new features in this release.
IP Restrict Middleware
Introducing IP Restrict Middleware. This middleware limits access to resources based on the IP address of the user.
import { getConnInfo } from 'hono/bun'
import { ipRestriction } from 'hono/ip-restriction'
const app = new Hono()
app.use(
'*',
ipRestriction(getConnInfo, {
denyList: [],
allowList: ['127.0.0.1', '::1']
})
)
Thanks @ nakasyou!
Combine Middleware
Introducing Combine Middleware. This middleware combines multiple middleware functions into a single middleware, allowing you to create complex access controls by combining it with middleware like IP Restriction.
import { bearerAuth } from 'hono/bearer-auth'
import { getConnInfo } from 'hono/cloudflare-workers'
import { every, some } from 'hono/combine'
import { ipRestriction } from 'hono/ip-restriction'
import { rateLimit } from '@/my-rate-limit'
const app = new Hono()
app.use(
'*',
some(
every(ipRestriction(getConnInfo, { allowList: ['192.168.0.2'] }), bearerAuth({ token })),
// If both conditions are met, rateLimit will not execute.
rateLimit()
)
)
app.get('/', (c) => c.text('Hello Hono!'))
Thanks @ usualoma!
Request ID Middleware
Introducing Request ID Middleware. This middleware generates a unique ID for each request, which you can use in your handlers.
import { requestId } from 'hono/request-id'
const app = new Hono()
app.use('*', requestId())
app.get('/', (c) => {
return c.text(
Your request id is <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">c</span><span class="pl-kos">.</span><span class="pl-en">get</span><span class="pl-kos">(</span><span class="pl-s">'requestId'</span><span class="pl-kos">)</span><span class="pl-kos">}</span></span>
)})
Thanks @ ryuapp!
Service Worker Adapter
A Service Worker adapter has been added, making it easier to run Hono applications as Service Workers.
For example, the following code works perfectly in a browser!
import { handle } from 'hono/service-worker'
const app = new Hono().basePath('/sw')
app.get('/', (c) => c.text('Hello World'))
self.addEventListener('fetch', handle(app))
Thanks @ nakasyou!
Cloudflare Pages Middleware
The Cloudflare Pages adapter now includes a
handleMiddleware
function, allowing many Hono middleware to run as Cloudflare Pages middleware.For example, to apply basic authentication, you can use the built-in middleware as shown below.
import { handleMiddleware } from 'hono/cloudflare-pages'
import { basicAuth } from 'hono/basic-auth'
export const onRequest = handleMiddleware(
basicAuth({
username: 'hono',
password: 'acoolproject'
}</spa...