Fork me on GitHub
#juxt
<
2019-01-10
>
WhoNeedszZz05:01:40

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

WhoNeedszZz05:01:25

Here's what I have for :access-control

WhoNeedszZz06:01:10

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

WhoNeedszZz06:01:07

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

WhoNeedszZz06:01:49

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

WhoNeedszZz07:01:22

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

WhoNeedszZz07:01:20

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

WhoNeedszZz07:01:23

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?

WhoNeedszZz16:01:08

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

dominicm17:01:52

The yada author is on holiday 😊

dominicm17:01:21

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

dominicm17:01:35

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

WhoNeedszZz21:01:03

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.