Permalink
Browse files

Update server.php

静态变量没有清除, 导致下次访问,get post等数据混乱
  • Loading branch information...
xxiyj committed May 13, 2015
1 parent b85540e commit 02831c7a76a085f3255055f86896129a7209debd
Showing with 9 additions and 1 deletion.
  1. +9 −1 server/server.php
View
@@ -28,15 +28,23 @@ public function __construct() {
$http->on('request', function ($request, $response) {
if( isset($request->server) ) {
HttpServer::$server = $request->server;
}else{
HttpServer::$server = [];
}
if( isset($request->header) ) {
HttpServer::$header = $request->header;
}else{
HttpServer::$header = [];
}
if( isset($request->get) ) {
HttpServer::$get = $request->get;
}else{
HttpServer::$get = [];
}
if( isset($request->post) ) {
HttpServer::$post = $request->post;
}else{
HttpServer::$post = [];
}
// TODO handle img
@@ -86,4 +94,4 @@ public static function getInstance() {
}
}
HttpServer::getInstance();
HttpServer::getInstance();

0 comments on commit 02831c7

Please sign in to comment.