Skip to content

Commit

Permalink
Merge branch 'master' into v1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
fengqi committed Apr 27, 2017
2 parents 57a6ed3 + 1d5333c commit 8d387de
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
7 changes: 4 additions & 3 deletions CHANGELOG-1.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# CHANGELOG for 1.X

## v1.5.2
## v1.5.4
- Request::file() 注释调整, 返回值注释改为 UploadFile

## v1.5.3
- 修正配置获取错误

## v1.5.2

### 修正
- 修正获取请求头部信息
- Request 添加 acceptWebP 方法判断浏览器是否支持 webp
- 时区从配置文件读取
Expand Down
1 change: 1 addition & 0 deletions src/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ public function run()
$kernel = $this->make('HttpKernel');

$request = Request::createFromGlobals();
$request::enableHttpMethodParameterOverride();
$response = $kernel->handle($request);

$response->send();
Expand Down
3 changes: 2 additions & 1 deletion src/Http/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace awheel\Http;

use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\HttpFoundation\Request as SymfonyRequest;

/**
Expand Down Expand Up @@ -36,7 +37,7 @@ public function all()
*
* @param $key
*
* @return mixed
* @return UploadedFile
*/
public function file($key)
{
Expand Down
3 changes: 2 additions & 1 deletion src/Http/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@ public function setContentType($contentType)
public function setContent($content)
{
if (is_array($content) || $content instanceof ArrayAccess || $content instanceof JsonSerializable) {
$this->headers->add(['Content-Type' => 'application/json']);
$this->headers->add(['Content-Type' => 'application/json; charset=utf-8']);
$content = json_encode($content, JSON_UNESCAPED_UNICODE);
}

parent::setContent($content);
parent::setCharset('utf-8');

return $this;
}
Expand Down

0 comments on commit 8d387de

Please sign in to comment.