File tree Expand file tree Collapse file tree 3 files changed +7
-8
lines changed
packages/react-on-rails-pro-node-renderer/src/worker Expand file tree Collapse file tree 3 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -10,11 +10,15 @@ import { timingSafeEqual } from 'crypto';
1010import type { FastifyRequest } from './types.js' ;
1111import { getConfig } from '../shared/configBuilder.js' ;
1212
13- export default function authenticate ( req : FastifyRequest ) {
13+ export interface AuthBody {
14+ password ?: string ;
15+ }
16+
17+ export function authenticate ( body : AuthBody ) {
1418 const { password } = getConfig ( ) ;
1519
1620 if ( password ) {
17- const reqPassword = ( req . body as { password ?: string } ) . password || '' ;
21+ const reqPassword = body . password || '' ;
1822
1923 // Use timing-safe comparison to prevent timing attacks
2024 // Both strings must be converted to buffers of the same length
Original file line number Diff line number Diff line change @@ -40,13 +40,8 @@ export interface RequestBody {
4040 railsEnv ?: string ;
4141}
4242
43- < < < << << HEAD :packages / r e a c t - o n - r a i l s - p r o - n o d e - r e n d e r e r / src/ worker / checkProtocolVersionHandler . ts
44- export default function checkProtocolVersion ( req : FastifyRequest ) {
45- const { protocolVersion : reqProtocolVersion , gemVersion, railsEnv } = req . body as RequestBody ;
46- = === ===
4743export function checkProtocolVersion ( body : RequestBody ) {
4844 const { protocolVersion : reqProtocolVersion , gemVersion, railsEnv } = body ;
49- > >>> >>> 7 b1608e57 ( Refactor request handling by consolidating prechecks ) :react_on_rails_pro / packages / node - renderer / src / worker / checkProtocolVersionHandler . ts
5045
5146 // Check protocol version
5247 if ( reqProtocolVersion !== packageJson . protocolVersion ) {
Original file line number Diff line number Diff line change @@ -376,7 +376,7 @@ export async function buildExecutionContext(
376376 return result ;
377377 } catch ( exception ) {
378378 const exceptionMessage = formatExceptionMessage ( renderingRequest , exception ) ;
379- log . debug ( 'Caught exception in rendering request' , exceptionMessage ) ;
379+ log . debug ( 'Caught exception in rendering request: %s ' , exceptionMessage ) ;
380380 return Promise . resolve ( { exceptionMessage } ) ;
381381 }
382382 } ;
You can’t perform that action at this time.
0 commit comments