Giter Club home page Giter Club logo

Comments (6)

leahneukirchen avatar leahneukirchen commented on July 23, 2024 1

Run Caddy (I use 2.6.4 but shouldn't matter too much):

% caddy run
2023/05/30 11:35:27.475	INFO	admin	admin endpoint started	{"address": "localhost:2019", "enforce_origin": false, "origins": ["//localhost:2019", "//[::1]:2019", "//127.0.0.1:2019"]}

Speak to the API:

% clj
Clojure 1.11.1
user=> (require '[org.httpkit.client])
nil
user=> @(org.httpkit.client/get "http://localhost:2019/config/")
{:opts {:method :get, :url "http://localhost:2019/config/"}, :error #error {
 :cause "Expected an empty line, but found Etag: \"/config/ 0e7c22ea\""
 :via
 [{:type org.httpkit.ProtocolException
   :message "Expected an empty line, but found Etag: \"/config/ 0e7c22ea\""
   :at [org.httpkit.client.Decoder readEmptyLine "Decoder.java" 144]}]
 :trace
 [[org.httpkit.client.Decoder readEmptyLine "Decoder.java" 144]
  [org.httpkit.client.Decoder decode "Decoder.java" 112]
  [org.httpkit.client.HttpClient doRead "HttpClient.java" 211]
  [org.httpkit.client.HttpClient run "HttpClient.java" 487]
  [java.lang.Thread run "Thread.java" 829]]}}

from http-kit.

ptaoussanis avatar ptaoussanis commented on July 23, 2024

@leahneukirchen Hi Leah, can you please share more about the code or context that you're referring to?

Is this issue related to http-kit server or client?
What exactly are you trying to do?

Thanks

from http-kit.

leahneukirchen avatar leahneukirchen commented on July 23, 2024

I use the http-kit client to talk to the Caddy configuration API, but it fails to parse the standards-compliant response because a Trailer: is sent with the last chunked part.

from http-kit.

ptaoussanis avatar ptaoussanis commented on July 23, 2024

I use the http-kit client to talk to the Caddy configuration API

Can you please provide an example? Something that can be easily reproduced would be ideal, thanks!

from http-kit.

ptaoussanis avatar ptaoussanis commented on July 23, 2024

Great, thanks for the clarification and report 👍

Sounds like a bug in the client decoder.

PR very welcome if you or someone else would be interested to take a look!

from http-kit.

ptaoussanis avatar ptaoussanis commented on July 23, 2024

Update: I took a quick stab at addressing this with 110b45e.

Looks straight-forward enough, but I'll keep this open for now in case anyone else is available to help review.

from http-kit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.