Skip to content

Commit

Permalink
Merge pull request #1564 from betagouv/hotfix/calc-distance
Browse files Browse the repository at this point in the history
Distance et durée calculées
  • Loading branch information
jonathanfallon authored Nov 10, 2021
2 parents 57eb3e2 + 4639d92 commit 559d98c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
11 changes: 9 additions & 2 deletions api/services/acquisition/src/actions/LogRequestAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,21 @@ export class LogRequestAction extends AbstractAction {

protected async handle(params: ParamsInterface, context: ContextType): Promise<ResultInterface> {
// clean up sensitive data
delete params.headers.cookie;
if ('headers' in params && 'cookie' in params.headers) {
delete params.headers.cookie;
}

if ('headers' in params && 'authorization' in params.headers) {
delete params.headers.authorization;
}

await this.repo.log({
error_stage: ErrorStage.Acquisition,
error_line: null,
operator_id: get(context, 'call.user.operator_id', params.operator_id || 0),
journey_id: params.journey_id,
journey_id: get(params, 'body.journey_id', get(params, 'journey_id', null)),
source: 'logrequest',
request_id: get(params, 'request_id', get(params, 'headers.x-request-id'), null),
error_message: null,
error_code: null,
auth: get(context, 'call.user'),
Expand Down
4 changes: 2 additions & 2 deletions shared/carpool/crosscheck.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ export const schema = {
},
},
},
calc_distance: { type: 'integer', minimum: 1, maximum: 2147483647 },
calc_duration: { type: 'integer', minimum: 1, maximum: 2147483647 },
calc_distance: { type: 'integer', minimum: 0, maximum: 2147483647 },
calc_duration: { type: 'integer', minimum: 0, maximum: 2147483647 },
},
},
},
Expand Down

0 comments on commit 559d98c

Please sign in to comment.