Giter VIP home page Giter VIP logo

hzzp's Introduction

About Me

I do random things from time to time.

You'll probably find me programming.

My current go to languages: Lua and Zig

My Site

truemedian.me

Github

Top Languages Github Stats

hzzp's People

Contributors

fengb avatar iddev5 avatar luexa avatar mattnite avatar nektro avatar truemedian avatar vrischmann avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

hzzp's Issues

Cannot handle HTTP/1.0 responses

Even though the library request HTTP/1.1, there are some servers (cough api.github.com) that returns HTTP/1.0. This is immediately "rejected" and infinite loops the event handler:

ClientEvent{ .invalid = Invalid{ .buffer = HTTP/1.0, .message = expected HTTP/1.1, .state = ParserState.initial } }

ClientEvent{ .invalid = Invalid{ .buffer = 403, .message = expected HTTP/1.1, .state = ParserState.initial } }

ClientEvent{ .invalid = Invalid{ .buffer = Forbidden
Cache-Control:, .message = expected HTTP/1.1, .state = ParserState.initial } }

// -- snip --

ClientEvent{ .invalid = Invalid{ .buffer = causes.
, .message = expected HTTP/1.1, .state = ParserState.initial } }

ClientEvent{ .closed = void }

ClientEvent{ .closed = void }

ClientEvent{ .closed = void }
// -- snip --

I think hzzp should support 1.0 parsing since afaik it's a strict subset of 1.1. Plus we should fix the bug where it infinite loops โ€” maybe invalid should be an error?

Use std.http.headers

(comment from it):

Design criteria:

  • the same header field is allowed more than once
  • must be able to fetch separate occurrences (important for some headers e.g. Set-Cookie)
  • optionally available as comma separated list
  • http2 adds flag to headers that they should never be indexed
  • header order should be recoverable

Headers are implemented as an array of entries.
An index of field name => array indices is kept.

Support Trailer: {header-names} Header

Hzzp does not currently support parsing trailing headers on chunked messages. This is part of the HTTP/1.1 and should be parsed.

Todo

  • Figure out how the trailing headers will be emitted. (should .header be emitted after .head_complete?)

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.