Git Product home page Git Product logo

hackttp's Introduction

hackttp's People

Contributors

fredemmott avatar jjergus avatar lexidor avatar usox avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

hackttp's Issues

response body should default to a temporary stream of some kind

If request_output is directly passed, then writing to the stream will take effect immediately.

Nothing should be written to real output until it's actually dealt finished

For example:

await $r->withHeader('foo', vec['bar'])->getBody()->writeAsync("Herp derp");

... the header will not be set as the response body will have been sent before anything else can be done with the request

Host not set on request URI

<<__EntryPoint>>
async function site_main_async(): Awaitable<noreturn> {
   $request = Usox\HackTTP\createServerRequestFromGlobals();
   \var_dump($request->getUri()->getHost());
   exit(0);
}
$ curl -H "Host: docs.hhvm.com" http://localhost:8080
string(0) ""
$ curl http://localhost:8080
string(0) ""

Check header handling

We need to check whether the current header handling complies with the rules provided by the interfaces (normalization and such)

Add ServerRequest tests

ServerRequest is currently untested due to some open issues on the interface side. Those issues are withdrawn (for now), so we can finalize ServerRequest

Add integration tests

It's nice to have unittests, but we really need some integration-tests, too... But wait until #6 is finished

More resource wrapper required

Currently, there is only UploadedStream. So we need at least an UploadedFile version to deal with files which have been uploaded - maybe more to come...

Type error while creating sever request from globals

this issue is encountered with $_FILES and $_COOKIE


reproduce :

$_FILES :

$_FILES = [
    'slide-shows' => [
      'tmp_name' => [
        // Note: Nesting *under* tmp_name/etc
        0 => ['slides' => [0 => __FILE__, 1 => __FILE__]],
      ],
      'error' => [0 => ['slides' => [0 => 0, 1 => 0]]],
      'name' => [0 => ['slides' => [0 => 'foo.txt', 1 => 'bar.txt']]],
      'size' => [0 => ['slides' => [0 => 123, 1 => 200]]],
      'type' => [0 => ['slides' => [0 => 'text/plain', 1 => 'text/plain']]],
    ],
  ];

$_COOKIE :

$_COOKIE = [
  'foo' => ['bar', 'bar' => 'baz', 'qux' => 'dux'],
  'bar' => ['bar' => ['baz' => ['qux' => 'dux']]]
];

see : https://github.com/azjezz/http-normalizer#normalize

Add tests/ to .gitattributes export-ignore

Currently, the -dev dependencies are effectively non-dev dependencies in the typechecker.

Can be worked around with ignored_paths, but should ideally be ignored.

$ hh_client
vendor/usox/hackttp/tests/RequestFactoryTest.hh:15:12,15: Unbound name (typing): Usox\HackMock\mock (Typing[4107])
vendor/usox/hackttp/tests/RequestFactoryTest.hh:15:12,15: Unbound name: Usox\HackMock\mock (a global constant) (Naming[2049])
vendor/usox/hackttp/tests/RequestFactoryTest.hh:15:12,15: Unbound name: Usox\HackMock\mock (a global function) (Naming[2049])
vendor/usox/hackttp/tests/RequestFactoryTest.hh:17:5,12: Unbound name (typing): Usox\HackMock\prospect (Typing[4107])
vendor/usox/hackttp/tests/RequestFactoryTest.hh:17:5,12: Unbound name: Usox\HackMock\prospect (a global constant) (Naming[2049])
vendor/usox/hackttp/tests/RequestFactoryTest.hh:17:5,12: Unbound name: Usox\HackMock\prospect (a global function) (Naming[2049])

For example, https://github.com/hhvm/hsl/blob/master/.gitattributes

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.