Skip to content

Commit 0a0ec4f

Browse files
authored
Merge pull request #385 from formidablejs/patch/security-2025-08-11
Patch/security 2025 08 11
2 parents ae707c8 + cb13295 commit 0a0ec4f

4 files changed

Lines changed: 68 additions & 66 deletions

File tree

package-lock.json

Lines changed: 48 additions & 48 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
},
3434
"dependencies": {
3535
"@fastify/cookie": "^11.0.2",
36-
"@fastify/cors": "^11.0.1",
36+
"@fastify/cors": "^11.1.0",
3737
"@fastify/formbody": "^8.0.2",
3838
"@fastify/multipart": "^9.0.3",
3939
"@fastify/session": "^11.1.0",
@@ -42,10 +42,10 @@
4242
"bcrypt": "^6.0.0",
4343
"connect-redis": "^9.0.0",
4444
"detect-port": "^2.1.0",
45-
"dotenv": "^17.0.1",
46-
"express-session": "^1.18.1",
45+
"dotenv": "^17.2.0",
46+
"express-session": "^1.18.2",
4747
"fastify": "^5.4.0",
48-
"fs-extra": "^11.3.0",
48+
"fs-extra": "^11.3.1",
4949
"html-escaper": "^3.0.3",
5050
"inquirer": "^8.2.4",
5151
"jsonwebtoken": "^9.0.2",
@@ -55,7 +55,7 @@
5555
"ms": "^2.1.3",
5656
"nodemon": "^3.1.10",
5757
"pluralize": "^8.0.0",
58-
"redis": "^5.5.6",
58+
"redis": "^5.8.0",
5959
"session-file-store": "^1.5.0",
6060
"stacktrace-js": "^2.0.2",
6161
"ts-node": "^10.9.2",

src/Environment/Repository.imba

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ export default class Repository
1616
env = fs.existsSync(envPath) ? envPath : path.join(root, '.env')
1717

1818
dotenv.config({
19-
path: env
19+
path: env,
20+
quiet: true,
2021
})
2122

2223
delete process.env.BUILD_ENV

types/Http/Request/FormRequest.d.ts

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ export default class FormRequest {
127127
/**
128128
* Get request headers.
129129
*/
130-
headers(): any;
130+
headers<T = any>(): T;
131131

132132
/**
133133
* Check if header is present.
@@ -152,32 +152,32 @@ export default class FormRequest {
152152
* Get specified header.
153153
* @param {string} header
154154
*/
155-
header(header: string, default$?: any): any;
155+
header<T = any>(header: string, default$?: T): T;
156156

157157
/**
158158
* Get bearer token used to authenticate current request.
159159
*/
160-
bearerToken(): any;
160+
bearerToken(): string | null;
161161

162162
/**
163163
* Get request referer.
164164
*/
165-
referer(): any;
165+
referer(): string | null;
166166

167167
/**
168168
* Get request host.
169169
*/
170-
getHost(): any;
170+
getHost(): string | null;
171171

172172
/**
173173
* Get full request host.
174174
*/
175-
getFullOrigin(): any;
175+
getFullOrigin(): string | null;
176176

177177
/**
178178
* Get request origin.
179179
*/
180-
getOrigin(): any;
180+
getOrigin(): string | null;
181181

182182
/**
183183
* Get request origin protocol.
@@ -187,7 +187,7 @@ export default class FormRequest {
187187
/**
188188
* Get request ip address.
189189
*/
190-
ip(): any;
190+
ip(): string | null;
191191

192192
/**
193193
* Check if path matches.
@@ -205,7 +205,7 @@ export default class FormRequest {
205205
* Get url param.
206206
* @param {string} name
207207
*/
208-
param(name: string): string | number;
208+
param<T = string | number>(name: string): T;
209209

210210
/**
211211
* Get all url params.
@@ -221,7 +221,7 @@ export default class FormRequest {
221221
* Get body input or specified query keys.
222222
* @param {string[]} keys
223223
*/
224-
all(keys?: string[]): any;
224+
all<T = any>(keys?: string[]): T;
225225

226226
/**
227227
* Get specified input from body.
@@ -251,7 +251,7 @@ export default class FormRequest {
251251
* Get specified query.
252252
* @param {string|null} key
253253
*/
254-
query(key?: string | null, default$?: any): string | number;
254+
query<T = string | number>(key?: string | null, default$?: any): T
255255

256256
/**
257257
* Get files.
@@ -302,7 +302,7 @@ export default class FormRequest {
302302
* Get request rules.
303303
* @returns {object}
304304
*/
305-
getRules(): object;
305+
getRules<T = ReturnType<T['rules']>>(): T;
306306

307307
/**
308308
* Get currently authenticated user.
@@ -324,6 +324,7 @@ import type Session from "./Session";
324324
import type Cookies from "./Cookies";
325325
import type { FastifyRequest } from "fastify";
326326
import type { FastifyReply } from "fastify";
327+
import s from "connect-redis";
327328

328329
declare const $__patch__$: unique symbol;
329330
declare const $__init__$: unique symbol;

0 commit comments

Comments
 (0)