Created
April 21, 2016 11:41
-
-
Save mrdaemon/72eadb52d45194e72502b812c93382c1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ProxyDav; | |
use strict; | |
use ModPerl::Util (); | |
use Apache2::RequestRec (); | |
use APR::Table (); | |
use URI; | |
use Apache2::Const -compile => qw(OK); | |
sub handler { | |
my $request = shift; | |
my $method = $request->method(); | |
if($method eq 'MOVE' || $method eq 'COPY') { | |
my $destination = $request->headers_in()->get('Destination'); | |
my $new_destination = URI->new($destination); | |
$new_destination->scheme('http'); | |
$request->headers_in()->set('Destination', $new_destination); | |
} | |
return Apache2::Const::OK(); | |
} | |
1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment