juxt

WhoNeedszZz 2019-01-10T05:18:40.021400Z

Having some difficulty with CORS on yada. I'm following the documentation, but still getting Cross-Origin Request BLocked: ... Reason: missing token ‘content-type’ in CORS header ‘Access-Control-Allow-Headers’ from CORS preflight channel

WhoNeedszZz 2019-01-10T05:19:25.021500Z

Here's what I have for :access-control

WhoNeedszZz 2019-01-10T06:07:10.023600Z

I was able to get rid of that error by changing to :allow-headers ["Content-Type"], but now Stripe Checkout is hitting A request was made of a resource using a request method not supported by that resource. clojure.lang.ExceptionInfo: Method Not Allowed {:status 405, :headers {"allow" "POST, OPTIONS"}}. It doesn't say which method it tried and failed so I'm a bit confused

WhoNeedszZz 2019-01-10T06:08:07.024200Z

POST, HEAD, and OPTIONS are enabled and it should be doing a POST so I'm baffled

WhoNeedszZz 2019-01-10T06:22:49.025400Z

I have :allow-methods #{:post :options :head} so why is it not reporting HEAD in the allow?

WhoNeedszZz 2019-01-10T07:07:22.026100Z

Now it worked without me changing anything and then when I changed some naming of symbols around then it stopped working. This is driving me nuts

WhoNeedszZz 2019-01-10T07:37:20.027700Z

Ha! Typical. The problem the whole time is that I didn't realize one of the uri parameters had a space in it from processing some text so it split it up into two malformed uris. I'm not sure why the error came about though

WhoNeedszZz 2019-01-10T07:41:23.029600Z

So I'm currently using java-http-clj for the http client because I tried that out before it was mentioned about using aleph since it is used in yada. That being said if I were to change it to that how exactly would I go about that? Is there a way to access the http client from the aleph code already being used or would I just be requiring aleph again explicitly and just creating a new client?

WhoNeedszZz 2019-01-10T16:16:08.030Z

Any JUXT people around to answer the question at the end there?

dominicm 2019-01-10T17:38:52.030600Z

The yada author is on holiday 😊

dominicm 2019-01-10T17:39:21.031300Z

I think you can just require Aleph and go from there.

dominicm 2019-01-10T17:39:35.031800Z

It isn't stateful, there's no client object.

WhoNeedszZz 2019-01-10T21:53:03.032700Z

Right, I'm asking if there would be any practical difference since java-http-clj has zero dependencies as it just wraps the Java http client that's already there.