1
0
Fork 0

- skipped redirect if parsing of iri failed.

This commit is contained in:
cage 2021-11-15 18:17:21 +01:00
parent e5597c6a80
commit 5e035458fe
2 changed files with 4 additions and 3 deletions

View File

@ -641,8 +641,8 @@
(flet ((on-input-complete (maybe-accepted)
(when (ui::boolean-input-accepted-p maybe-accepted)
(pop-url-from-history specials:*message-window*)
(let ((new-url (gemini-client:build-redirect-iri meta
parsed-iri)))
(when-let ((new-url (gemini-client:build-redirect-iri meta
parsed-iri)))
(db-utils:with-ready-database (:connect nil)
(request new-url
:enqueue enqueue

View File

@ -541,7 +541,8 @@ TODO: Add client certificate."
(labels ((redirect-dispatch (status code-description meta response socket iri parsed-iri)
(declare (ignore status code-description response socket parsed-iri))
(when (< redirect-count +maximum-redirections+)
(slurp-gemini-url (build-redirect-iri meta iri) (1+ redirect-count))))
(when-let ((iri-redirect (build-redirect-iri meta iri)))
(slurp-gemini-url iri-redirect (1+ redirect-count)))))
(success-dispatch (status code-description meta response socket iri parsed-iri)
(declare (ignorable code-description iri meta parsed-iri))
(debug-gemini "success response data: ~s ~s ~s ~s ~s ~s"