summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVivien Kraus <vivien@planete-kraus.eu>2021-10-11 21:01:21 +0200
committerVivien Kraus <vivien@planete-kraus.eu>2021-10-12 22:43:03 +0200
commit70befab4002c5d54745879685e691fff7d222816 (patch)
treea9bc7ef5196ebb69af60170dec493eedd6b4de50
parent81081d1fbf71edb72465b9be12cf3b29eaa77767 (diff)
client: infer the https:// URI scheme if it’s missing
-rw-r--r--po/disfluid.pot20
-rw-r--r--po/fr.po22
-rw-r--r--src/scm/webid-oidc/client/application.scm6
3 files changed, 26 insertions, 22 deletions
diff --git a/po/disfluid.pot b/po/disfluid.pot
index a7d319e..4676cfa 100644
--- a/po/disfluid.pot
+++ b/po/disfluid.pot
@@ -615,33 +615,33 @@ msgstr ""
msgid "The issuer should be a string or URI."
msgstr ""
-#: src/scm/webid-oidc/client/application.scm:259
+#: src/scm/webid-oidc/client/application.scm:260
#, scheme-format
msgid "Add an account on ~a"
msgstr ""
-#: src/scm/webid-oidc/client/application.scm:274
+#: src/scm/webid-oidc/client/application.scm:275
#, scheme-format
msgid ""
"You already have an account for ~a issued by ~a and it is currently selected."
msgstr ""
-#: src/scm/webid-oidc/client/application.scm:293
+#: src/scm/webid-oidc/client/application.scm:294
#, scheme-format
msgid "You already have an account for ~a issued by ~a."
msgstr ""
-#: src/scm/webid-oidc/client/application.scm:393
+#: src/scm/webid-oidc/client/application.scm:397
msgid "the page URI (#:uri) should be a string encoding an URI or an URI"
msgstr ""
-#: src/scm/webid-oidc/client/application.scm:420
+#: src/scm/webid-oidc/client/application.scm:424
msgid ""
"the error code (#:code) should be an integer and the reason phrase (#:reason-"
"phrase) should be a string"
msgstr ""
-#: src/scm/webid-oidc/client/application.scm:468
+#: src/scm/webid-oidc/client/application.scm:472
msgid ""
"the etag (#:etag) should be a string or #f, the links (#:links) should be a "
"list of links, the content-type (#:content-type) should be a symbol or a "
@@ -649,24 +649,24 @@ msgid ""
"string or a bytevector"
msgstr ""
-#: src/scm/webid-oidc/client/application.scm:504
+#: src/scm/webid-oidc/client/application.scm:508
msgid ""
"the desired links (#:desired-links) should be an alist from URI to alists, "
"the desired content-type (#:desired-content-type) should be a symbol, and "
"the desired content (#:desired-content) should be a string or a bytevector"
msgstr ""
-#: src/scm/webid-oidc/client/application.scm:588
+#: src/scm/webid-oidc/client/application.scm:592
#, scheme-format
msgid "Loading ~a..."
msgstr ""
-#: src/scm/webid-oidc/client/application.scm:667
+#: src/scm/webid-oidc/client/application.scm:671
#, scheme-format
msgid "Updating ~a (expected ETag ~a)"
msgstr ""
-#: src/scm/webid-oidc/client/application.scm:714
+#: src/scm/webid-oidc/client/application.scm:718
#, scheme-format
msgid "Deleting ~a (expected ETag ~a)"
msgstr ""
diff --git a/po/fr.po b/po/fr.po
index a4591e8..0882942 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -3,7 +3,7 @@ msgstr ""
"Project-Id-Version: webid-oidc 0.0.0\n"
"Report-Msgid-Bugs-To: vivien@planete-kraus.eu\n"
"POT-Creation-Date: 2021-10-12 22:41+0200\n"
-"PO-Revision-Date: 2021-10-12 22:40+0200\n"
+"PO-Revision-Date: 2021-10-12 22:42+0200\n"
"Last-Translator: Vivien Kraus <vivien@planete-kraus.eu>\n"
"Language-Team: French <vivien@planete-kraus.eu>\n"
"Language: fr\n"
@@ -664,12 +664,12 @@ msgstr "Le sujet doit être une chaîne de caractères ou une URI."
msgid "The issuer should be a string or URI."
msgstr "L’émetteur doit être une chaîne de caractères ou une URI."
-#: src/scm/webid-oidc/client/application.scm:259
+#: src/scm/webid-oidc/client/application.scm:260
#, scheme-format
msgid "Add an account on ~a"
msgstr "Ajouter un compte sur ~a"
-#: src/scm/webid-oidc/client/application.scm:274
+#: src/scm/webid-oidc/client/application.scm:275
#, scheme-format
msgid ""
"You already have an account for ~a issued by ~a and it is currently selected."
@@ -677,18 +677,18 @@ msgstr ""
"Vous avez déjà un compte pour ~a émis par ~a et il est actuellement "
"sélectionné."
-#: src/scm/webid-oidc/client/application.scm:293
+#: src/scm/webid-oidc/client/application.scm:294
#, scheme-format
msgid "You already have an account for ~a issued by ~a."
msgstr "Vous avez déjà un compte pour ~a émis par ~a."
-#: src/scm/webid-oidc/client/application.scm:393
+#: src/scm/webid-oidc/client/application.scm:397
msgid "the page URI (#:uri) should be a string encoding an URI or an URI"
msgstr ""
"l’URI de la page doit être une chaîne de caractères encodant une URI ou une "
"URI"
-#: src/scm/webid-oidc/client/application.scm:420
+#: src/scm/webid-oidc/client/application.scm:424
msgid ""
"the error code (#:code) should be an integer and the reason phrase (#:reason-"
"phrase) should be a string"
@@ -696,7 +696,7 @@ msgstr ""
"le code d’erreur (#:code) doit être un entier et l’explication (#:reason-"
"phrase) doit être une chaîne de caractères"
-#: src/scm/webid-oidc/client/application.scm:468
+#: src/scm/webid-oidc/client/application.scm:472
msgid ""
"the etag (#:etag) should be a string or #f, the links (#:links) should be a "
"list of links, the content-type (#:content-type) should be a symbol or a "
@@ -708,7 +708,7 @@ msgstr ""
"être un symbole ou une liste dont le premier élément est un symbole, et le "
"contenu (#:content) doit être une chaîne de caractères ou un vecteur d’octets"
-#: src/scm/webid-oidc/client/application.scm:504
+#: src/scm/webid-oidc/client/application.scm:508
msgid ""
"the desired links (#:desired-links) should be an alist from URI to alists, "
"the desired content-type (#:desired-content-type) should be a symbol, and "
@@ -719,17 +719,17 @@ msgstr ""
"symbole, et le ccontenu désiré (#:desired-content-type) doit être unne "
"chaîne de caractères ou un vecteur d’octets"
-#: src/scm/webid-oidc/client/application.scm:588
+#: src/scm/webid-oidc/client/application.scm:592
#, scheme-format
msgid "Loading ~a..."
msgstr "Chargement de ~a…"
-#: src/scm/webid-oidc/client/application.scm:667
+#: src/scm/webid-oidc/client/application.scm:671
#, scheme-format
msgid "Updating ~a (expected ETag ~a)"
msgstr "Mise à jour de ~a (ETag attendu ~a)"
-#: src/scm/webid-oidc/client/application.scm:714
+#: src/scm/webid-oidc/client/application.scm:718
#, scheme-format
msgid "Deleting ~a (expected ETag ~a)"
msgstr "Suppression de ~a (ETag attendu ~a)"
diff --git a/src/scm/webid-oidc/client/application.scm b/src/scm/webid-oidc/client/application.scm
index 2ce286d..bde0018 100644
--- a/src/scm/webid-oidc/client/application.scm
+++ b/src/scm/webid-oidc/client/application.scm
@@ -27,6 +27,7 @@
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-9)
#:use-module (srfi srfi-19)
+ #:use-module (srfi srfi-26)
#:use-module (webid-oidc errors)
#:use-module (webid-oidc http-link)
#:use-module ((webid-oidc parameters) #:prefix p:)
@@ -386,7 +387,10 @@
(let do-initialize ((uri uri))
(match uri
((or (? string? (= string->uri (? uri? uri)))
- (? uri? uri))
+ (? uri? uri)
+ (? string?
+ (= (cute string-append "https://" <>)
+ (= string->uri (? uri? uri)))))
(slot-set! page 'uri uri))
(else
(scm-error 'wrong-type-arg "make <page-with-uri>"