From e614308fed6eafc2fccce37837fd16c406f54116 Mon Sep 17 00:00:00 2001 From: 3846masa <3846masahiro+git@gmail.com> Date: Sat, 22 Dec 2018 23:40:00 +0900 Subject: [PATCH] Add test checkHost should allow urls with scheme --- test/Validation.test.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/Validation.test.js b/test/Validation.test.js index 12c54d7e83..8dc0f98cb6 100644 --- a/test/Validation.test.js +++ b/test/Validation.test.js @@ -171,6 +171,19 @@ describe('Validation', () => { } }); + it('should allow urls with scheme for checking origin', () => { + const options = { + public: 'test.host:80' + }; + const headers = { + origin: 'https://test.host' + }; + const server = new Server(compiler, options); + if (!server.checkHost(headers, 'origin')) { + throw new Error("Validation didn't fail"); + } + }); + describe('allowedHosts', () => { it('should allow hosts in allowedHosts', () => { const tests = [