add proxy support

This commit is contained in:
Kacper Donat 2019-12-10 20:29:44 +01:00
parent 2e2cf65a46
commit bcdc94384b
4 changed files with 6 additions and 7 deletions

View File

@ -18,9 +18,4 @@ describe("Get departures for one stop", () => {
it ('Shows departures from picked stop', () => {
cy.get('#departures .departures .stop__name').should('contain.text', 'Lipowa');
});
// it("Allows to open favourites window", () => {
// cy.get('#open_favourites_picker').click();
// cy.get('#favourites_list').should('exist');
// })
});

View File

@ -24,6 +24,10 @@ if ($debug) {
Debug::enable();
}
if (isset($_ENV['http_proxy'])) {
stream_context_set_default(['http' => ['proxy' => $_ENV['http_proxy']]]);
}
if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? false) {
Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);
}

View File

@ -51,7 +51,7 @@ class StopsController extends Controller
break;
default:
$result = $stops->getAllGroups();
$result = $stops->getAll();
}
return $this->json($result->all());

View File

@ -52,7 +52,7 @@ class ZtmGdanskDepartureRepository implements DepartureRepository
'vehicle' => $this->reference->get(Vehicle::class, $delay['vehicleCode']),
'line' => $lines->get($delay['routeId']) ?: Line::createFromArray([
'symbol' => $delay['routeId'],
'type' => Line::TYPE_UNKNOWN
'type' => Line::TYPE_UNKNOWN,
]),
]);
})->values();