Skip to content

Commit

Permalink
Merge branch 'master' of github.com:kitetail/zttp into add_shared_coo…
Browse files Browse the repository at this point in the history
…kies_between_requests
  • Loading branch information
bastien-phi committed Oct 11, 2017
2 parents 28aabf4 + 9c5508e commit 074e6e0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"require-dev": {
"phpunit/phpunit": "^6.0",
"laravel/lumen-framework": "^5.4"
"laravel/lumen-framework": "5.5.*"
},
"autoload": {
"files": [
Expand Down
24 changes: 12 additions & 12 deletions tests/server/public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,43 +17,43 @@ function build_response($request)
], $request->header('Z-Status', 200));
}

$app->get('/get', function () {
$app->router->get('/get', function () {
return build_response(app('request'));
});

$app->post('/post', function () {
$app->router->post('/post', function () {
return build_response(app('request'));
});

$app->put('/put', function () {
$app->router->put('/put', function () {
return build_response(app('request'));
});

$app->patch('/patch', function () {
$app->router->patch('/patch', function () {
return build_response(app('request'));
});

$app->delete('/delete', function () {
$app->router->delete('/delete', function () {
return build_response(app('request'));
});

$app->get('/redirect', function () {
$app->router->get('/redirect', function () {
return redirect('redirected');
});

$app->get('/redirected', function () {
$app->router->get('/redirected', function () {
return "Redirected!";
});

$app->get('/simple-response', function () {
$app->router->get('/simple-response', function () {
return "A simple string response";
});

$app->get('/timeout', function () {
$app->router->get('/timeout', function () {
sleep(2);
});

$app->get('/basic-auth', function () {
$app->router->get('/basic-auth', function () {
$headers = [
(bool) preg_match('/Basic\s[a-zA-Z0-9]+/', app('request')->header('Authorization')),
app('request')->header('php-auth-user') === 'zttp',
Expand All @@ -63,7 +63,7 @@ function build_response($request)
return (count(array_unique($headers)) === 1) ? response(null, 200) : response(null, 401);
});

$app->get('/digest-auth', function () {
$app->router->get('/digest-auth', function () {
$realm = 'Restricted area';

$authorization = app('request')->server->get('PHP_AUTH_DIGEST');
Expand Down Expand Up @@ -97,7 +97,7 @@ function build_response($request)
return response(200);
});

$app->post('/multi-part', function () {
$app->router->post('/multi-part', function () {
return response()->json([
'body_content' => app('request')->only(['foo', 'baz']),
'has_file' => app('request')->hasFile('test-file'),
Expand Down

0 comments on commit 074e6e0

Please sign in to comment.