From 6c0577b226f1b89aaf6eeafe262532ebe4f073e6 Mon Sep 17 00:00:00 2001 From: Petr Rockai Date: Fri, 29 Mar 2013 22:57:32 +0100 Subject: [PATCH] Respect X-Request-Base header coming from a frontend proxy. --- deps.nix | 1 + src/lib/Hydra.pm | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/deps.nix b/deps.nix index 9a931f87..6d36d997 100644 --- a/deps.nix +++ b/deps.nix @@ -13,6 +13,7 @@ with pkgs; perlPackages.CatalystViewJSON perlPackages.CatalystViewTT perlPackages.CatalystXScriptServerStarman + perlPackages.CatalystTraitForRequestProxyBase perlPackages.CryptRandPasswd perlPackages.DBDPg perlPackages.DBDSQLite diff --git a/src/lib/Hydra.pm b/src/lib/Hydra.pm index 4f42b0f0..732d56d3 100644 --- a/src/lib/Hydra.pm +++ b/src/lib/Hydra.pm @@ -3,6 +3,7 @@ package Hydra; use strict; use warnings; use parent 'Catalyst'; +use Moose; use Hydra::Model::DB; use Catalyst::Runtime '5.70'; use Catalyst qw/ConfigLoader @@ -16,6 +17,8 @@ use Catalyst qw/ConfigLoader AccessLog Captcha/, '-Log=warn,fatal,error'; +use CatalystX::RoleApplicator; + our $VERSION = '0.01'; @@ -77,6 +80,8 @@ __PACKAGE__->config( }, ); +__PACKAGE__->apply_request_class_roles(qw/Catalyst::TraitFor::Request::ProxyBase/); + __PACKAGE__->setup(); 1;