Commit eaef4a8c authored by Christopher Lemmer Webber's avatar Christopher Lemmer Webber

Absolute urls, and use them for inbox/outbox

parent 5bd1bf7e
......@@ -45,6 +45,8 @@
(make-parameter #f))
(define magenc-store
(make-parameter #f))
(define base-url
(make-parameter #f))
;;; Routing
;;; =======
......@@ -56,6 +58,20 @@
[("outbox") outbox]
[("enc" (string-arg)) serve-encrypted-object]))
(define (golem-absolute-url handler)
(define local-path
(url-path (path->url (golem-url handler))))
(url (url-scheme (base-url))
(url-user (base-url))
(url-host (base-url))
(url-port (base-url))
'() #f))
(define (golem-absolute-url-str handler)
(url->string (golem-absolute-url handler)))
;;; Pages
;;; =====
......@@ -76,8 +92,8 @@
[(member "application/activity+json" headers)
(define profile
`#hasheq((name . ,(users-name))
(inbox . ,(golem-url inbox))
(outbox . ,(golem-url outbox))))
(inbox . ,(golem-absolute-url-str inbox))
(outbox . ,(golem-absolute-url-str outbox))))
(ok (json->bytes profile)
#:content-type #"application/activity+json")]
;; Return the html page
......@@ -182,5 +198,6 @@
(parameterize ([users-name "Alice"]
[db 'TODO]
[magenc-store 'TODO])
[magenc-store 'TODO]
[base-url (string->url "http://localhost:8000")])
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment