hono 1.4.3 → 1.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ /// <reference path="request.d.ts" />
1
2
  export { Hono } from './hono';
2
3
  export type { Handler, Next } from './hono';
3
4
  export { Context } from './context';
package/dist/index.js CHANGED
@@ -1,4 +1,6 @@
1
1
  "use strict";
2
+ // eslint-disable-next-line @typescript-eslint/triple-slash-reference
3
+ /// <reference path="./request.ts" /> Import "declare global" for the Request interface.
2
4
  Object.defineProperty(exports, "__esModule", { value: true });
3
5
  exports.Context = exports.Hono = void 0;
4
6
  var hono_1 = require("./hono");
@@ -10,7 +10,7 @@ const jwt = (options) => {
10
10
  const credentials = ctx.req.headers.get('Authorization');
11
11
  if (!credentials) {
12
12
  ctx.res = new Response('Unauthorized', {
13
- status: 400,
13
+ status: 401,
14
14
  headers: {
15
15
  'WWW-Authenticate': `Bearer realm="${ctx.req.url}",error="invalid_request",error_description="no authorization included in request"`,
16
16
  },
@@ -20,7 +20,7 @@ const jwt = (options) => {
20
20
  const parts = credentials.split(/\s+/);
21
21
  if (parts.length !== 2) {
22
22
  ctx.res = new Response('Unauthorized', {
23
- status: 400,
23
+ status: 401,
24
24
  headers: {
25
25
  'WWW-Authenticate': `Bearer realm="${ctx.req.url}",error="invalid_request",error_description="no authorization included in request"`,
26
26
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hono",
3
- "version": "1.4.3",
3
+ "version": "1.4.4",
4
4
  "description": "Ultrafast web framework for Cloudflare Workers.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",