Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
checkHost should allow urls with scheme
  • Loading branch information
3846masa committed Dec 22, 2018
1 parent 1c56116 commit e614308
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/Validation.test.js
Expand Up @@ -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 = [
Expand Down

0 comments on commit e614308

Please sign in to comment.