Compare commits

...
3 changed files with 10 additions and 7 deletions
+3
View File
@@ -3,6 +3,7 @@ import { NestFactory } from '@nestjs/core';
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger'; import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
import helmet from 'helmet'; import helmet from 'helmet';
import { DadosferaLogger } from '@dadosfera/dadosfera-logs'; import { DadosferaLogger } from '@dadosfera/dadosfera-logs';
import { json, urlencoded } from 'express';
import { AppModule } from './app.module'; import { AppModule } from './app.module';
import { writeFileSync } from 'fs'; import { writeFileSync } from 'fs';
@@ -25,6 +26,8 @@ async function bootstrap() {
}, },
}); });
app.use(helmet()); app.use(helmet());
app.use('/catalog/register-dataset', json({ limit: '10mb' }));
app.use('/catalog/register-dataset', urlencoded({ extended: true, limit: '10mb' }));
configureSwagger(app); configureSwagger(app);
await app.listen(3333); await app.listen(3333);
if (process.env.KILL_AFTER_START) await app.close(); if (process.env.KILL_AFTER_START) await app.close();
@@ -45,11 +45,11 @@ export class OpenDataController {
) { ) {
this.logger.info('createUser for open data' + JSON.stringify(request.headers)); this.logger.info('createUser for open data' + JSON.stringify(request.headers));
const corslist = ["https://devsbm.dadosfera.io", "https://sharingoceandata.com"]; // const corslist = ["https://devsbm.dadosfera.io", "https://sharingoceandata.com"];
if (!corslist.includes(origin)) { // if (!corslist.includes(origin)) {
this.logger.info('block request by cors list: '+ origin); // this.logger.info('block request by cors list: '+ origin);
throw new ForbiddenException(); // throw new ForbiddenException();
} // }
const OPENDATA_CUSTOMER_ID = process.env.OPEN_CUSTOMER_ID; const OPENDATA_CUSTOMER_ID = process.env.OPEN_CUSTOMER_ID;
const OPENDATA_GROUP_ID = process.env.OPEN_GROUP_ID; const OPENDATA_GROUP_ID = process.env.OPEN_GROUP_ID;
+2 -2
View File
@@ -22,7 +22,7 @@ export class PDFParser<T> implements Parser<T> {
const html = await this.htmlParser.parse(data); const html = await this.htmlParser.parse(data);
await page.setContent(html, { await page.setContent(html, {
waitUntil: 'networkidle0', waitUntil: 'networkidle0',
timeout: 30000, timeout: 90000,
}); });
// Configurações adicionais para garantir um PDF válido // Configurações adicionais para garantir um PDF válido
@@ -43,7 +43,7 @@ export class PDFParser<T> implements Parser<T> {
pageRanges: '', pageRanges: '',
tagged: true, tagged: true,
outline: false, outline: false,
timeout: 30000, timeout: 90000,
}); });
await browser.close(); await browser.close();