Fork me on GitHub
#pedestal
<
2019-10-02
>
wei04:10:16

what's the best way to route /item/:uuid.json to one handler and /item/:uuid.csv to another handler?

orestis09:10:52

I think Reitit can do that, not sure about pedestals router...

đź‘Ť 4
erwinrooijakkers08:10:31

I am using Lacinia Pedestal and want to set some cookies to expired

erwinrooijakkers08:10:13

What I tried to set multiple cookies is this interceptor:

(def make-some-cookies-interceptor
  (fn [request]
    {:status 200
     :headers {"Set-Cookie" "a=; b=; c=; path=/;"}}))
This works only for the first cookie a. I also want to create a cookie b and c. What is the correct way to create multiple cookies?

orestis09:10:52

Perhaps you should also at the generic Clojure channel as you might get some ring-specific advice

orestis11:10:54

BTW I looked into this via https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie -- it seems that you can only set one cookie at a time

orestis11:10:09

so perhaps you could pass in a vector of headers instead?

orestis11:10:32

{"Set-Cookie" ["a=; path=/;" "b=; path=/;"]}

orestis11:10:41

Not sure if that works, haven't tried it

mkvlr08:10:45

anybody here know of a byte-range header implementation for jetty/pedestal? Use case is supporting video playback for iOS.

Eduardo Mata15:10:47

Howdy Y'all. I have been working on a small framework using pedestal io and integrant. The framework is used to create a server that serves user define APIs, State, Redis Processors, and Server Sent Events. Everything works greate, however, I noticed that when multiple clients are connected to the web app, the server sent events will only send data to one client at the time and it sends data in a particular order. The way the server sent events are implemented is with Core Async and the Pedestal library for SSE. such as

(def sse (chan 2046))

(defn stream-ready
"Get data from the sse channel and put it in `channel`. this is how SSE are sent to the client"
[channel context-map]
(go-loop []
  (async/put! channel (async/<! sse)))

(defn stream-data
"Put data in the sse channel"
[data]
(async/put! sse data))