nrepl

https://github.com/nrepl/nrepl || https://nrepl.org
2020-03-06T15:36:16.016100Z

Aha, trying curl with POST reveals something.

2020-03-06T15:37:57.017400Z

$ curl -v -d "(+ 1 1)" -H "Content-Type: text/plain" <http://127.0.0.1:8080/repl>
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0)
&gt; POST /repl HTTP/1.1
&gt; Host: 127.0.0.1:8080
&gt; User-Agent: curl/7.58.0
&gt; Accept: */*
&gt; Content-Type: text/plain
&gt; Content-Length: 7
&gt; 
* upload completely sent off: 7 out of 7 bytes
&lt; HTTP/1.1 403 Forbidden
&lt; Content-Type: text/html
&lt; Server: Aleph/0.4.4
&lt; Connection: Keep-Alive
&lt; Date: Fri, 06 Mar 2020 15:35:21 GMT
&lt; content-length: 35
&lt; 
* Connection #0 to host 127.0.0.1 left intact
&lt;h1&gt;Invalid anti-forgery token&lt;/h1&gt;
^^ So the error is unique to our tool, and I'll have to figure out how to disable this check.

2020-03-06T16:05:16.018Z

Commenting out one of the relevant lines in the app (for now) I have gotten past that. Now I see a different error that seems legitimately related to Drawbridge.

2020-03-06T16:05:39.018600Z

$ lein repl :connect <http://127.0.0.1:8080/repl>
Connecting to nREPL at <http://127.0.0.1:8080/repl>
IllegalArgumentException Cannot open &lt;nil&gt; as a Reader.
	<http://clojure.java.io/fn--11490|clojure.java.io/fn--11490> (io.clj:288)
	<http://clojure.java.io/fn--11490|clojure.java.io/fn--11490> (io.clj:288)
	<http://clojure.java.io/fn--11392/G--11368--11399|clojure.java.io/fn--11392/G--11368--11399> (io.clj:69)
	<http://clojure.java.io/reader|clojure.java.io/reader> (io.clj:102)
	<http://clojure.java.io/reader|clojure.java.io/reader> (io.clj:86)
	drawbridge.client/ring-client-transport/fill--4204 (client.clj:25)
	drawbridge.client/ring-client-transport/http--4208 (client.clj:42)
	nrepl.transport.FnTransport (transport.clj:41)
	nrepl.core/client/this--9259 (core.clj:56)
	clojure.core/comp/fn--5792 (core.clj:2569)
	clojure.core/comp/fn--5792 (core.clj:2569)
	clojure.lang.AFunction$1.doInvoke (AFunction.java:31)
Bye for now!

bozhidar 2020-03-06T17:01:09.019300Z

Probably it’s something to do with the web server that drawbridge starts, not so much with drawbridge itself.

bozhidar 2020-03-06T17:01:19.019700Z

Unfortunately I’m slammed at work these days, so I can’t look into this.

2020-03-06T17:38:38.022600Z

I can try to make a minimal reproduction which is bound to be helpful. Possibly I'll even be able to find the problem. I created a ticket in the issue tracker and will update there with any progress.

bozhidar 2020-03-06T17:52:17.022800Z

Sounds good! :thumbsup_all: