Skip to content

Commit

Permalink
One more renaming + eslint fixes + adaption of unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
codeworrior committed Apr 18, 2019
1 parent 7fd8846 commit 10a8a74
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,16 @@ module.exports = {
* @param {string} [options.cert] Path to certificate to be used for for https
* @param {boolean} [options.acceptRemoteConnections=false] If true, listens to remote connections and
* not only to localhost connections
* @param {boolean} [sendSapTargetCSPs=false] If true, then the content security policies that SAP and UI5
* aim for (AKA 'target policies'), are send for any requested
* <code>*.html</code> file
* @param {boolean} [options.sendSAPTargetCSP=false] If true, then the content security policies that SAP and UI5
* aim for (AKA 'target policies'), are send for any requested
* <code>*.html</code> file
* @returns {Promise<Object>} Promise resolving once the server is listening.
* It resolves with an object containing the <code>port</code>,
* <code>h2</code>-flag and a <code>close</code> function,
* which can be used to stop the server.
*/
serve(tree, {port, changePortIfInUse = false, h2 = false, key, cert, acceptRemoteConnections = false,
sendSapTargetCSPs = false}) {
sendSAPTargetCSP = false}) {
return Promise.resolve().then(() => {
const projectResourceCollections = resourceFactory.createCollectionsForTree(tree);

Expand Down Expand Up @@ -159,7 +159,7 @@ module.exports = {
"connect-src 'self' https: wss:;"
}
};
if ( sendSapTargetCSPs ) {
if ( sendSAPTargetCSP ) {
Object.assign(oCspConfig, {
defaultPolicy: "sap-target-level-1",
defaultPolicyIsReportOnly: true,
Expand Down
2 changes: 1 addition & 1 deletion test/lib/server/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ test("CSP (sap policies)", (t) => {
}).then((tree) => {
return server.serve(tree, {
port,
sendSapPolicies: true
sendSAPTargetCSP: true
});
}).then((serveResult) => {
localServeResult = serveResult;
Expand Down

0 comments on commit 10a8a74

Please sign in to comment.