Skip to content

Commit

Permalink
feat(hapi-cors): enable CORS server side
Browse files Browse the repository at this point in the history
  • Loading branch information
sridharvoruganti committed Feb 13, 2021
1 parent d7b2d38 commit f4b5d12
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 51 deletions.
96 changes: 48 additions & 48 deletions audit-resolve.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,123 +2,123 @@
"decisions": {
"1500|jest>@jest/core>jest-config>@jest/test-sequencer>jest-runner>jest-jasmine2>jest-runtime>yargs>yargs-parser": {
"decision": "ignore",
"madeAt": 1612516633486,
"expiresAt": 1613121425404
"madeAt": 1613237532319,
"expiresAt": 1613842296728
},
"1500|jest>jest-cli>@jest/core>jest-config>@jest/test-sequencer>jest-runner>jest-jasmine2>jest-runtime>yargs>yargs-parser": {
"decision": "ignore",
"madeAt": 1612516633486,
"expiresAt": 1613121425404
"madeAt": 1613237532319,
"expiresAt": 1613842296728
},
"1500|jest>@jest/core>jest-runner>jest-jasmine2>jest-runtime>yargs>yargs-parser": {
"decision": "ignore",
"madeAt": 1612516633486,
"expiresAt": 1613121425404
"madeAt": 1613237532319,
"expiresAt": 1613842296728
},
"1500|jest>jest-cli>@jest/core>jest-runner>jest-jasmine2>jest-runtime>yargs>yargs-parser": {
"decision": "ignore",
"madeAt": 1612516633486,
"expiresAt": 1613121425404
"madeAt": 1613237532320,
"expiresAt": 1613842296728
},
"1500|jest>@jest/core>jest-config>jest-jasmine2>jest-runtime>yargs>yargs-parser": {
"decision": "ignore",
"madeAt": 1612516633490,
"expiresAt": 1613121425404
"madeAt": 1613237532320,
"expiresAt": 1613842296728
},
"1500|jest>jest-cli>@jest/core>jest-config>jest-jasmine2>jest-runtime>yargs>yargs-parser": {
"decision": "ignore",
"madeAt": 1612516633490,
"expiresAt": 1613121425404
"madeAt": 1613237532320,
"expiresAt": 1613842296728
},
"1500|jest>@jest/core>jest-runner>jest-config>jest-jasmine2>jest-runtime>yargs>yargs-parser": {
"decision": "ignore",
"madeAt": 1612516633490,
"expiresAt": 1613121425404
"madeAt": 1613237532320,
"expiresAt": 1613842296728
},
"1500|jest>jest-cli>@jest/core>jest-runner>jest-config>jest-jasmine2>jest-runtime>yargs>yargs-parser": {
"decision": "ignore",
"madeAt": 1612516633490,
"expiresAt": 1613121425404
"madeAt": 1613237532320,
"expiresAt": 1613842296728
},
"1500|jest>@jest/core>jest-config>@jest/test-sequencer>jest-runner>jest-runtime>yargs>yargs-parser": {
"decision": "ignore",
"madeAt": 1612516633490,
"expiresAt": 1613121425404
"madeAt": 1613237532320,
"expiresAt": 1613842296728
},
"1500|jest>jest-cli>@jest/core>jest-config>@jest/test-sequencer>jest-runner>jest-runtime>yargs>yargs-parser": {
"decision": "ignore",
"madeAt": 1612516633490,
"expiresAt": 1613121425404
"madeAt": 1613237532320,
"expiresAt": 1613842296728
},
"1500|jest>@jest/core>jest-runner>jest-runtime>yargs>yargs-parser": {
"decision": "ignore",
"madeAt": 1612516633490,
"expiresAt": 1613121425404
"madeAt": 1613237532320,
"expiresAt": 1613842296728
},
"1500|jest>jest-cli>@jest/core>jest-runner>jest-runtime>yargs>yargs-parser": {
"decision": "ignore",
"madeAt": 1612516633491,
"expiresAt": 1613121425404
"madeAt": 1613237532320,
"expiresAt": 1613842296728
},
"1500|jest>@jest/core>jest-config>@jest/test-sequencer>jest-runtime>yargs>yargs-parser": {
"decision": "ignore",
"madeAt": 1612516633491,
"expiresAt": 1613121425404
"madeAt": 1613237532320,
"expiresAt": 1613842296728
},
"1500|jest>jest-cli>@jest/core>jest-config>@jest/test-sequencer>jest-runtime>yargs>yargs-parser": {
"decision": "ignore",
"madeAt": 1612516633491,
"expiresAt": 1613121425404
"madeAt": 1613237532320,
"expiresAt": 1613842296728
},
"1500|jest>@jest/core>jest-runner>jest-config>@jest/test-sequencer>jest-runtime>yargs>yargs-parser": {
"decision": "ignore",
"madeAt": 1612516633491,
"expiresAt": 1613121425404
"madeAt": 1613237532320,
"expiresAt": 1613842296728
},
"1500|jest>jest-cli>@jest/core>jest-runner>jest-config>@jest/test-sequencer>jest-runtime>yargs>yargs-parser": {
"decision": "ignore",
"madeAt": 1612516633491,
"expiresAt": 1613121425404
"madeAt": 1613237532320,
"expiresAt": 1613842296728
},
"1500|jest>@jest/core>jest-runtime>yargs>yargs-parser": {
"decision": "ignore",
"madeAt": 1612516633491,
"expiresAt": 1613121425404
"madeAt": 1613237532320,
"expiresAt": 1613842296728
},
"1500|jest>jest-cli>@jest/core>jest-runtime>yargs>yargs-parser": {
"decision": "ignore",
"madeAt": 1612516633491,
"expiresAt": 1613121425404
"madeAt": 1613237532321,
"expiresAt": 1613842296728
},
"1500|nyc>yargs>yargs-parser": {
"decision": "ignore",
"madeAt": 1612516633491,
"expiresAt": 1613121425404
"madeAt": 1613237532321,
"expiresAt": 1613842296728
},
"1500|jest>jest-cli>jest-config>@jest/test-sequencer>jest-runner>jest-jasmine2>jest-runtime>yargs>yargs-parser": {
"decision": "ignore",
"madeAt": 1612516633491,
"expiresAt": 1613121425404
"madeAt": 1613237532321,
"expiresAt": 1613842296728
},
"1500|jest>jest-cli>jest-config>jest-jasmine2>jest-runtime>yargs>yargs-parser": {
"decision": "ignore",
"madeAt": 1612516633491,
"expiresAt": 1613121425404
"madeAt": 1613237532321,
"expiresAt": 1613842296728
},
"1500|jest>jest-cli>jest-config>@jest/test-sequencer>jest-runner>jest-runtime>yargs>yargs-parser": {
"decision": "ignore",
"madeAt": 1612516633491,
"expiresAt": 1613121425404
"madeAt": 1613237532321,
"expiresAt": 1613842296728
},
"1500|jest>jest-cli>jest-config>@jest/test-sequencer>jest-runtime>yargs>yargs-parser": {
"decision": "ignore",
"madeAt": 1612516633491,
"expiresAt": 1613121425404
"madeAt": 1613237532321,
"expiresAt": 1613842296728
},
"1500|jest>jest-cli>yargs>yargs-parser": {
"decision": "ignore",
"madeAt": 1612516633491,
"expiresAt": 1613121425404
"madeAt": 1613237532321,
"expiresAt": 1613842296728
}
},
"rules": {},
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ml-testing-toolkit",
"description": "Testing Toolkit for Mojaloop implementations",
"version": "11.8.0",
"version": "11.8.1",
"license": "Apache-2.0",
"author": "Vijaya Kumar Guthi, ModusBox Inc.",
"contributors": [
Expand Down
18 changes: 17 additions & 1 deletion src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,27 @@ const createServer = async (port, user) => {
ca: [tlsConfig.hubCaCert],
rejectUnauthorized: true,
requestCert: false
},
routes: {
cors: {
origin: ['*'],
credentials: true,
headers: ['Origin', 'X-Requested-With', 'Content-Type', 'Accept', 'Authorization'],
exposedHeaders: ['Content-Disposition']
}
}
})
} else {
server = new Hapi.Server({
port
port,
routes: {
cors: {
origin: ['*'],
credentials: true,
headers: ['Origin', 'X-Requested-With', 'Content-Type', 'Accept', 'Authorization'],
exposedHeaders: ['Content-Disposition']
}
}
})
}

Expand Down

0 comments on commit f4b5d12

Please sign in to comment.