Skip to content

Instantly share code, notes, and snippets.

@mrdaemon
Created April 21, 2016 11:41
Show Gist options
  • Save mrdaemon/72eadb52d45194e72502b812c93382c1 to your computer and use it in GitHub Desktop.
Save mrdaemon/72eadb52d45194e72502b812c93382c1 to your computer and use it in GitHub Desktop.
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