From 0426dc993e4820631f5e341c1b314763fefe549d Mon Sep 17 00:00:00 2001
From: Jacek Kowalski <Jacek@jacekk.info>
Date: Sat, 15 Apr 2017 14:29:04 +0000
Subject: [PATCH] Change navbar behavior on mobile devices to lower its height
---
proxy.php | 22 ++++++++++++++++++----
1 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/proxy.php b/proxy.php
index ff9eb34..dad3670 100644
--- a/proxy.php
+++ b/proxy.php
@@ -1,20 +1,34 @@
<?php
-$base_proxy = 'http://www.ttss.krakow.pl/internetservice/services';
+$base_proxy = 'http://www.ttss.krakow.pl/internetservice';
$method = [
- '/lookup/autocomplete/json' => [
+ '/services/lookup/autocomplete/json' => [
'query' => function() { return TRUE; },
],
- '/passageInfo/stopPassages/stop' => [
+ '/services/passageInfo/stopPassages/stop' => [
'stop' => 'ctype_alnum',
'mode' => function($mode) { return in_array($mode, ['arrival', 'departure']); },
],
- '/routeInfo/routeStops' => [
+ '/services/tripInfo/tripPassages' => [
+ 'tripId' => 'ctype_digit',
+ 'mode' => function($mode) { return in_array($mode, ['arrival', 'departure']); },
+ #'vehicleId' => 'ctype_digit',
+ ],
+ '/services/routeInfo/routeStops' => [
'routeId' => 'ctype_alnum'
],
];
+$rewrite = [
+ '/lookup/autocomplete/json' => '/services/lookup/autocomplete/json',
+ '/passageInfo/stopPassages/stop' => '/services/passageInfo/stopPassages/stop',
+ '/routeInfo/routeStops' => '/services/routeInfo/routeStops',
+];
$path = $_SERVER['PATH_INFO'];
+if(isset($rewrite[$path])) {
+ $path = $rewrite[$path];
+}
+
if(!isset($method[$path])) {
header('HTTP/1.1 403 Forbidden');
die('Forbidden');
--
Gitblit v1.9.1