diff --git a/kong/web/app.lua b/kong/web/app.lua index 49794b9414d5..aa89e59590f6 100644 --- a/kong/web/app.lua +++ b/kong/web/app.lua @@ -34,6 +34,16 @@ app:get("/", function(self) }) end) +app.default_route = function(self) + local path = self.req.parsed_url.path:match("^(.*)/$") + + if path and self.app.router:resolve(path, self) then + return + end + + return self.app.handle_404(self) +end + app.handle_404 = function(self) return utils.not_found() end diff --git a/kong/web/routes/base_controller.lua b/kong/web/routes/base_controller.lua index b5dcaa749918..7abf25d41d6c 100644 --- a/kong/web/routes/base_controller.lua +++ b/kong/web/routes/base_controller.lua @@ -102,7 +102,7 @@ function BaseController.parse_params(schema, params) end function BaseController:new(dao_collection, collection) - app:post("/"..collection.."/", function(self) + app:post("/"..collection, function(self) if not check_content_type(self.req, FORM_URLENCODED_TYPE) then return utils.unsupported_media_type(FORM_URLENCODED_TYPE) end @@ -116,7 +116,7 @@ function BaseController:new(dao_collection, collection) end end) - app:get("/"..collection.."/", function(self) + app:get("/"..collection, function(self) local size = self.params.size if size then size = tonumber(size) diff --git a/package-build.sh b/package-build.sh index c0f4e1f3c977..89842c50f2e5 100755 --- a/package-build.sh +++ b/package-build.sh @@ -47,6 +47,16 @@ if [ "$(uname)" = "Darwin" ]; then make install DESTDIR=$OUT cd $OUT + # Install OpenSSL + cd $TMP + wget https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz + tar xzf openssl-$OPENSSL_VERSION.tar.gz + cd openssl-$OPENSSL_VERSION + ./Configure darwin64-x86_64-cc + make + sudo make install + cd $OUT + OPENRESTY_CONFIGURE="--with-cc-opt=-I$OUT/usr/local/include --with-ld-opt=-L$OUT/usr/local/lib" FPM_PARAMS="--osxpkg-identifier-prefix org.getkong" elif hash yum 2>/dev/null; then @@ -74,13 +84,8 @@ else exit 1 fi -cd $TMP -wget http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.2.tar.gz -tar xvfvz ruby-2.1.2.tar.gz -cd ruby-2.1.2 -./configure -make -sudo make install +curl -sSL https://get.rvm.io | bash -s stable +~/.rvm/scripts/rvm get stable sudo gem update --system sudo gem install fpm diff --git a/versions.sh b/versions.sh index 21b4f8b78352..e34d89389596 100755 --- a/versions.sh +++ b/versions.sh @@ -8,4 +8,5 @@ OPENRESTY_VERSION=1.7.10.2rc0 # Package builder only LUA_VERSION=5.1.5 PCRE_VERSION=8.36 +OPENSSL_VERSION=1.0.2a KONG_VERSION=0.1.1beta-2