Show
Ignore:
Timestamp:
09/29/06 09:29:04 (3 years ago)
Author:
aimbert
Message:

add a path filter t the AtomStream:

- the AtomInject plugin receives a PUT request on a given path ("$put_path") with the content of an entry.
- the AtomStream plugin receives a GET request on another path ("$get_path/atom-stream.xml") (the arg 'since' is still allowed)

$put_path and $get_path can be '/' or '/a' or '/a/b', ....

then the AtomStream plugin produces a result filtered like this:

GET /atom-stream.xml returns everything ('/' or '/a' or '/a/b')
GET /a/atom-stream.xml returns the entries put with '/a' or '/a/b'
GET /a/b/atom-stream.xml returns the entries put with '/a/b'

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/lib/Perlbal/Plugin/AtomInject.pm

    r431 r580  
    2222 
    2323        my $uri = $hds->request_uri; 
    24         return $self->send_response(400, "Invalid uri") unless $uri eq "/"; 
    25  
     24        return $self->send_response(400, "Invalid uri") unless $uri =~ /^\//; 
     25        $self->{scratch}{path} = $uri; 
     26         
    2627        # now abort the normal handle_put processing... 
    2728        return 1; 
     
    3839        $self->{read_ahead} = 0; 
    3940 
    40         my $rv = eval { Perlbal::Plugin::AtomStream->InjectFeed(\$data); }; 
     41        my $rv = eval { Perlbal::Plugin::AtomStream->InjectFeed(\$data, $self->{scratch}{path}); }; 
    4142        return $self->send_response(200); 
    4243    });