formacao
This commit is contained in:
+1
-1
@@ -2,7 +2,7 @@
|
||||
import { join } from "node:path";
|
||||
import { serveStatic as baseServeStatic } from "../../middleware/serve-static/index.js";
|
||||
var { open, lstatSync, errors } = Deno;
|
||||
var serveStatic = (options) => {
|
||||
var serveStatic = (options = {}) => {
|
||||
return async function serveStatic2(c, next) {
|
||||
const getContent = async (path) => {
|
||||
try {
|
||||
|
||||
+5
-1
@@ -4,7 +4,11 @@ var upgradeWebSocket = defineWebSocketHelper(async (c, events, options) => {
|
||||
if (c.req.header("upgrade") !== "websocket") {
|
||||
return;
|
||||
}
|
||||
const { response, socket } = Deno.upgradeWebSocket(c.req.raw, options ?? {});
|
||||
const subprotocol = c.req.header("sec-websocket-protocol")?.split(",")[0]?.trim();
|
||||
const { response, socket } = Deno.upgradeWebSocket(c.req.raw, {
|
||||
...subprotocol ? { protocol: subprotocol } : {},
|
||||
...options
|
||||
});
|
||||
const wsContext = new WSContext({
|
||||
close: (code, reason) => socket.close(code, reason),
|
||||
get protocol() {
|
||||
|
||||
Reference in New Issue
Block a user