Skip to content

Commit

Permalink
fix(types): fix unhandled types for Deno 2.2 (#3977)
Browse files Browse the repository at this point in the history
  • Loading branch information
yusukebe authored Mar 5, 2025
1 parent fe90028 commit 6952ae1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/adapter/bun/websocket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { getBunServer } from './server'
* @internal
*/
export interface BunServerWebSocket<T> {
send(data: string | ArrayBufferLike, compress?: boolean): void
send(data: string | ArrayBuffer | Uint8Array, compress?: boolean): void
close(code?: number, reason?: string): void
data: T
readyState: 0 | 1 | 2 | 3
Expand Down
6 changes: 3 additions & 3 deletions src/middleware/secure-headers/secure-headers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ type SecureHeadersCallback = (
) => [string, string][]

const generateNonce = () => {
const buffer = new Uint8Array(16)
crypto.getRandomValues(buffer)
return encodeBase64(buffer)
const arrayBuffer = new Uint8Array(16)
crypto.getRandomValues(arrayBuffer)
return encodeBase64(arrayBuffer.buffer)
}

export const NONCE: ContentSecurityPolicyOptionHandler = (ctx) => {
Expand Down

0 comments on commit 6952ae1

Please sign in to comment.