π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Validate URLs
Manav Rathi3b3c802aa4c8
diff --git a/web/packages/new/photos/components/DevSettings.tsx b/web/packages/new/photos/components/DevSettings.tsxindex 387e4c3073..8d93945951 100644--- a/web/packages/new/photos/components/DevSettings.tsx+++ b/web/packages/new/photos/components/DevSettings.tsx@@ -1,3 +1,4 @@+import { apiOrigin } from "@ente/shared/network/api";import InfoOutlinedIcon from "@mui/icons-material/InfoOutlined";import {Dialog,@@ -41,6 +42,14 @@ export const DevSettings: React.FC<DevSettingsProps> = ({ open, onClose }) => {initialValues: {apiOrigin: localStorage.getItem("apiOrigin") ?? "",},+ validate: ({ apiOrigin }) => {+ try {+ new URL(apiOrigin);+ } catch {+ return { apiOrigin: "Invalid endpoint" };+ }+ return {};+ },onSubmit: async (values, { setSubmitting, setErrors }) => {try {await updateAPIOrigin(values.apiOrigin);