Skip to content

Commit

Permalink
Item13897: Bug fixes
Browse files Browse the repository at this point in the history
- Fixed Request were not deleting parameters.

- Fixed NatEditPlugin RestSave setting Status header directly.
  • Loading branch information
vrurg committed Jul 8, 2016
1 parent ab60364 commit 2d96be2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
11 changes: 7 additions & 4 deletions NatEditPlugin/lib/Foswiki/Plugins/NatEditPlugin/RestSave.pm
Expand Up @@ -55,8 +55,11 @@ sub handle {
$app->create('Foswiki::UI::Save')->save;

# get a new lease
my $topicObject =
$app->create( 'Foswiki::Meta', $request->web, $request->topic );
my $topicObject = $app->create(
'Foswiki::Meta',
web => $request->web,
topic => $request->topic
);
$topicObject->setLease( $cfgData->{LeaseLength} );

}
Expand All @@ -67,8 +70,8 @@ sub handle {
};

# clear redirect enforced by a checkpoint action
$response->deleteHeader( "Location", "Status" );
$response->pushHeader( "Status", $status );
$response->deleteHeader("Location");
$response->status($status);

# add validation key to HTTP header, if required
unless ( $response->getHeader('X-Foswiki-Validation') ) {
Expand Down
1 change: 1 addition & 0 deletions core/lib/Foswiki/Request.pm
Expand Up @@ -685,6 +685,7 @@ sub delete {
my $this = shift;
foreach my $p (@_) {
next unless exists $this->_param->{$p};
CORE::delete $this->_param->{$p};
}
my %deleted_key = map { $_ => 1 } @_;
$this->param_list( [ grep { !$deleted_key{$_} } @{ $this->param_list } ] );
Expand Down
2 changes: 1 addition & 1 deletion core/lib/Foswiki/Response.pm
Expand Up @@ -535,7 +535,7 @@ sub as_array {
my $headers = $this->headers;
ASSERT( !defined $headers->{Status},
"the Status header is not set implicitly" )
"the Status header has been set implicitly but shouldn't" )
if DEBUG;
$rc[0] = $this->status;
Expand Down

0 comments on commit 2d96be2

Please sign in to comment.