aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-11-14 20:03:04 +0100
committerChocobozzz <florian.bigard@gmail.com>2016-11-16 20:29:26 +0100
commit49abbbbedca83b9031d3e2eb3ae9ad9b6a7d96ed (patch)
tree68c59d67637a297d513e07ea96ba236a7f0cd43b /client/src/app/shared
parent41b5da1d8cb41f5c49f0e0a01a54106c9a5925dd (diff)
downloadPeerTube-49abbbbedca83b9031d3e2eb3ae9ad9b6a7d96ed.tar.gz
PeerTube-49abbbbedca83b9031d3e2eb3ae9ad9b6a7d96ed.tar.zst
PeerTube-49abbbbedca83b9031d3e2eb3ae9ad9b6a7d96ed.zip
Pod URL -> pod host. HTTPS is required to make friends.
Reason: in a network with mix http/https pods, https pods won't be able to play videos from http pod (insecure requests).
Diffstat (limited to 'client/src/app/shared')
-rw-r--r--client/src/app/shared/forms/form-validators/host.validator.ts11
-rw-r--r--client/src/app/shared/forms/form-validators/index.ts2
-rw-r--r--client/src/app/shared/forms/form-validators/url.validator.ts11
3 files changed, 12 insertions, 12 deletions
diff --git a/client/src/app/shared/forms/form-validators/host.validator.ts b/client/src/app/shared/forms/form-validators/host.validator.ts
new file mode 100644
index 000000000..9cb46d361
--- /dev/null
+++ b/client/src/app/shared/forms/form-validators/host.validator.ts
@@ -0,0 +1,11 @@
1import { FormControl } from '@angular/forms';
2
3export function validateHost(c: FormControl) {
4 let HOST_REGEXP = new RegExp('^(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)$');
5
6 return HOST_REGEXP.test(c.value) ? null : {
7 validateHost: {
8 valid: false
9 }
10 };
11}
diff --git a/client/src/app/shared/forms/form-validators/index.ts b/client/src/app/shared/forms/form-validators/index.ts
index 1d2ae6f68..4c6cc6637 100644
--- a/client/src/app/shared/forms/form-validators/index.ts
+++ b/client/src/app/shared/forms/form-validators/index.ts
@@ -1,3 +1,3 @@
1export * from './url.validator'; 1export * from './host.validator';
2export * from './user'; 2export * from './user';
3export * from './video'; 3export * from './video';
diff --git a/client/src/app/shared/forms/form-validators/url.validator.ts b/client/src/app/shared/forms/form-validators/url.validator.ts
deleted file mode 100644
index 67163b4e9..000000000
--- a/client/src/app/shared/forms/form-validators/url.validator.ts
+++ /dev/null
@@ -1,11 +0,0 @@
1import { FormControl } from '@angular/forms';
2
3export function validateUrl(c: FormControl) {
4 let URL_REGEXP = new RegExp('^https?://(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)$');
5
6 return URL_REGEXP.test(c.value) ? null : {
7 validateUrl: {
8 valid: false
9 }
10 };
11}