Skip to content

Commit 1af9a98

Browse files
committed
update with public as root
1 parent 4443bce commit 1af9a98

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

.idea/sonarlint/issuestore/index.pb

Whitespace-only changes.

.idea/ubiquity-workerman.iml

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Ubiquity/servers/workerman/WorkermanServer.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* This class is part of Ubiquity
1414
*
1515
* @author jcheron <[email protected]>
16-
* @version 1.0.3
16+
* @version 1.0.4
1717
*/
1818
class WorkermanServer {
1919

@@ -118,7 +118,6 @@ public function run($host, $port, $options = []) {
118118
}
119119

120120
protected function handle(ConnectionInterface $connection, $datas) {
121-
// $_REQUEST['REQUEST_TIME_FLOAT']=\microtime(true);
122121
Http::header('Date: ' . \gmdate('D, d M Y H:i:s') . ' GMT');
123122
$_GET['c'] = '';
124123
$uriInfos = \Ubiquity\utils\http\URequest::parseURI($_SERVER['REQUEST_URI'], $this->basedir);
@@ -127,9 +126,10 @@ protected function handle(ConnectionInterface $connection, $datas) {
127126
$_GET['c'] = $uri;
128127
} else {
129128
if ($uriInfos['file']) {
130-
$mime = MimeType::getFileMimeType(realpath($uri));
129+
$file=$this->basedir .'/'. $uri;
130+
$mime = MimeType::getFileMimeType($file);
131131
Http::header('Content-Type: ' . $mime . '; charset=utf-8', true);
132-
return $connection->send(\file_get_contents($this->basedir . '/../' . $uri));
132+
return $connection->send(\file_get_contents($file));
133133
} else {
134134
Http::header('Content-Type: text/plain; charset=utf-8', true, 404);
135135
return $connection->send($uri . ' not found!');

0 commit comments

Comments
 (0)