Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: mod fastify querystring parser #355

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions server/pretense/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"@types/multer": "^1.4.7",
"@types/node": "^17.0.15",
"@types/node-fetch": "^2.5.10",
"@types/qs": "^6.9.7",
"@types/react": "^17.0.39",
"@types/react-dom": "^17.0.11",
"@typescript-eslint/eslint-plugin": "^5.10.2",
Expand Down Expand Up @@ -106,6 +107,7 @@
"postcss-html": "^1.3.0",
"prettier": "^2.5.1",
"prisma": "^3.9.1",
"qs": "^6.10.3",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-query": "^3.34.14",
Expand Down
1 change: 1 addition & 0 deletions server/templates/server/@server=fastify/@server-dep
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ fastify-helmet
fastify-jwt
fastify-multipart
fastify-static
qs
1 change: 1 addition & 0 deletions server/templates/server/@server=fastify/@server-dev-dep
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
@types/busboy
@types/qs
frourio
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import helmet from 'fastify-helmet'
import cors from 'fastify-cors'
import fastifyStatic from 'fastify-static'
import fastifyJwt from 'fastify-jwt'
import qs from 'qs'
import { createDBFileIfNotExists } from '$/service/tasks'
import {
API_JWT_SECRET,
Expand All @@ -13,7 +14,7 @@ import {
} from '$/service/envValues'
import server from '$/$server'

const fastify = Fastify()
const fastify = Fastify({ querystringParser: qs.parse })

fastify.register(helmet)
fastify.register(cors)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import helmet from 'fastify-helmet'
import cors from 'fastify-cors'
import fastifyStatic from 'fastify-static'
import fastifyJwt from 'fastify-jwt'
import qs from 'qs'
import { createConnection } from 'typeorm'
import server from '$/$server'
import ormOptions from '$/$orm'
Expand All @@ -20,7 +21,7 @@ import {
TYPEORM_PORT
} from '$/service/envValues'

const fastify = Fastify()
const fastify = Fastify({ querystringParser: qs.parse })

fastify.register(helmet)
fastify.register(cors)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import helmet from 'fastify-helmet'
import cors from 'fastify-cors'
import fastifyStatic from 'fastify-static'
import fastifyJwt from 'fastify-jwt'
import qs from 'qs'
import { API_JWT_SECRET, API_BASE_PATH, API_UPLOAD_DIR } from '$/service/envValues'
import server from '$/$server'

export const init = (serverFactory?: FastifyServerFactory) => {
const app = Fastify({ serverFactory })
const app = Fastify({ serverFactory, querystringParser: qs.parse })
app.register(helmet)
app.register(cors)
app.register(fastifyStatic, {
Expand Down