Skip to content

Commit

Permalink
Merge pull request #163 from ensdomains/mdt/decrease-response-timeout
Browse files Browse the repository at this point in the history
decrease response timeout
  • Loading branch information
mdtanrikulu committed May 10, 2023
2 parents 79deb11 + 0f75397 commit 49e0bbc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const ETH_REGISTRY_ABI = [
];

// response timeout: 1 min
const RESPONSE_TIMEOUT = 60 * 1000;
const RESPONSE_TIMEOUT = 10 * 1000;

export {
ADDRESS_ETH_REGISTRAR,
Expand Down
1 change: 1 addition & 0 deletions src/controller/ensMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export async function ensMetadata(req: Request, res: Response) {
// #swagger.parameters['tokenId'] = { type: 'string', description: 'Labelhash(v1) /Namehash(v2) of your ENS name.\n\nMore: https://docs.ens.domains/contract-api-reference/name-processing#hashing-names', schema: { $ref: '#/definitions/tokenId' } }
res.setTimeout(RESPONSE_TIMEOUT, () => {
res.status(504).json({ message: 'Timeout' });
return;
});

const { contractAddress, networkName, tokenId: identifier } = req.params;
Expand Down
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ app.use(
helmet.contentSecurityPolicy({
directives: {
defaultSrc: ["'none'"],
scriptSrc: ["'none'"],
scriptSrc: [
'https://unpkg.com/redoc@latest/bundles/redoc.standalone.js'
],
imgSrc: ['*', 'data:'],
styleSrc: ["'self'", "'unsafe-inline'"],
fontSrc: ["'self'", 'data:'],
Expand Down

0 comments on commit 49e0bbc

Please sign in to comment.