Browse Source

fixed upload

theme
npmrun 2 years ago
parent
commit
0b906730d0
  1. 11
      source/plugins/index.ts

11
source/plugins/index.ts

@ -6,6 +6,7 @@ import {ServerRegisterPluginObject, Plugin, Server, Request, ResponseObject} fro
import Hoek from "@hapi/hoek"
import HapiYar from "@hapi/yar";
import HapiCrumb from "@hapi/crumb"
import { Stream } from "stream";
export default [
{
@ -94,9 +95,13 @@ export default [
options: {
autoGenerate: true,
logUnauthorized: true,
// skip: function(request, reply) {
// return true;
// },
skip: function(request, reply) {
// 流的话直接通过,不需要验证,主要用于传递form-data数据时这里通不过
if(request.payload instanceof Stream){
return true
}
return false;
},
cookieOptions: {
path: '/',
isSecure: false

Loading…
Cancel
Save