[obs-commits] [openSUSE/open-build-service] 0bc6ee: [api] Better fix to work when hosted in non-root s...
Branch: refs/heads/master Home: https://github.com/openSUSE/open-build-service Commit: 0bc6ee2a470bee1a97b54d76ddad3e15ba2365de https://github.com/openSUSE/open-build-service/commit/0bc6ee2a470bee1a97b54d... Author: Oleg Girko <ol@infoserver.lv> Date: 2015-03-10 (Tue, 10 Mar 2015) Changed paths: M src/api/app/controllers/application_controller.rb M src/api/app/controllers/build_controller.rb M src/api/app/controllers/public_controller.rb M src/api/app/controllers/source_controller.rb Log Message: ----------- [api] Better fix to work when hosted in non-root server directory. This partially reverts commit 5eb11ac98543449f59e09b55e6b801878670c00a and implements more correct handling of hosting under non-root server pathname prefix. Instead of removing prefix from full path obtained from request.path, this change uses request.path_info which does not contain prefix at all. Also, << operator used to append to obtained path was replaced with += because unlike request.path which returns newly constructed string, request.path_info returns reference to environvent variable, so << operator appends to this environment variable, whereas += operator works on newly constructed string. Besides using more efficient way to obtain path without prefix, this change also fixes some cases which were not handled by the previous approach. Signed-off-by: Oleg Girko <ol@infoserver.lv> Commit: 7727d28dbc4ba1537713a81919bc727ffe9a1669 https://github.com/openSUSE/open-build-service/commit/7727d28dbc4ba1537713a8... Author: Adrian Schröter <adrian@suse.de> Date: 2015-03-10 (Tue, 10 Mar 2015) Changed paths: M src/api/app/controllers/application_controller.rb M src/api/app/controllers/build_controller.rb M src/api/app/controllers/public_controller.rb M src/api/app/controllers/source_controller.rb Log Message: ----------- Merge pull request #879 from OlegGirko/api-fix-root-path [api] Better fix to work when hosted in non-root server directory. Compare: https://github.com/openSUSE/open-build-service/compare/a3af0af62c55...7727d2...
participants (1)
-
Adrian Schröter