Skip to content

Commit

Permalink
fix: fix max header size bug in gw & server (#708)
Browse files Browse the repository at this point in the history
  • Loading branch information
maslow authored Jan 31, 2023
1 parent 44a82a4 commit 888ee82
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 12 deletions.
2 changes: 2 additions & 0 deletions deploy/build/charts/apisix/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,8 @@ configurationSnippet:
main: |
httpStart: |
client_header_buffer_size 1024k;
large_client_header_buffers 8 128k;
httpEnd: |
Expand Down
7 changes: 0 additions & 7 deletions deploy/build/charts/casdoor/templates/init_data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,6 @@ data:
"prompted": false,
"rule": "None"
},
{
"name": "Display name",
"visible": true,
"required": true,
"prompted": false,
"rule": "None"
},
{
"name": "Password",
"visible": true,
Expand Down
2 changes: 1 addition & 1 deletion server/src/auth/casdoor.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export class CasdoorService {
const endpoint = ServerConfig.CASDOOR_ENDPOINT
const query = {
client_id: ServerConfig.CASDOOR_CLIENT_ID,
redirect_uri: process.env.CASDOOR_REDIRECT_URI,
redirect_uri: ServerConfig.CASDOOR_REDIRECT_URI,
response_type: 'code',
scope: 'openid,profile,phone,email',
state: 'casdoor',
Expand Down
2 changes: 1 addition & 1 deletion server/src/function/function.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { JwtAuthGuard } from '../auth/jwt.auth.guard'
import { ApplicationAuthGuard } from '../auth/application.auth.guard'
import { FunctionService } from './function.service'
import { IRequest } from '../utils/interface'
import { CompileFunctionDto } from './dto/compile-function.dto.ts'
import { CompileFunctionDto } from './dto/compile-function.dto'
import { MAX_FUNCTION_COUNT } from 'src/constants'

@ApiTags('Function')
Expand Down
2 changes: 1 addition & 1 deletion server/src/function/function.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { CreateFunctionDto } from './dto/create-function.dto'
import { UpdateFunctionDto } from './dto/update-function.dto'
import * as assert from 'node:assert'
import { JwtService } from '@nestjs/jwt'
import { CompileFunctionDto } from './dto/compile-function.dto.ts'
import { CompileFunctionDto } from './dto/compile-function.dto'
import { DatabaseService } from 'src/database/database.service'

@Injectable()
Expand Down
8 changes: 6 additions & 2 deletions server/src/instance/instance.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { V1Deployment } from '@kubernetes/client-node'
import { Injectable, Logger } from '@nestjs/common'
import { GetApplicationNamespaceById } from '../utils/getter'
import { ResourceLabels } from '../constants'
import { MB, ResourceLabels } from '../constants'
import { PrismaService } from '../prisma.service'
import { StorageService } from '../storage/storage.service'
import { DatabaseService } from 'src/database/database.service'
Expand Down Expand Up @@ -56,6 +56,7 @@ export class InstanceService {
const requestMemory = app.bundle.requestMemory
const requestCpu = app.bundle.requestCPU
const max_old_space_size = ~~(limitMemory * 0.8)
const max_http_header_size = 1 * MB
const dependencies = app.configuration?.dependencies || []
const dependencies_string = dependencies.join(' ')

Expand All @@ -82,7 +83,10 @@ export class InstanceService {
value: app.region.storageConf.externalEndpoint,
},
{ name: 'OSS_REGION', value: app.region.name },
{ name: 'FLAGS', value: `--max_old_space_size=${max_old_space_size}` },
{
name: 'FLAGS',
value: `--max_old_space_size=${max_old_space_size} --max-http-header-size=${max_http_header_size}`,
},
{ name: 'DEPENDENCIES', value: dependencies_string },
]

Expand Down

0 comments on commit 888ee82

Please sign in to comment.