-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
%#
%# You should have received a copy of the GNU General Public License
%# along with this program; if not, write to the Free Software
-%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
+%# END BPS TAGGED BLOCK }}}
%# REST/1.0/dhandler
%#
<%ARGS>
my $name = qr{[\w.-]+};
my $list = '(?:(?:\d+-)?\d+,)*(?:\d+-)?\d+';
my $label = '[a-zA-Z0-9@_.+-]+';
-my $field = '[a-zA-Z][a-zA-Z0-9_-]*';
+my $field = '[a-zA-Z](?:[a-zA-Z0-9_-]|\s+)*';
my $labels = "(?:$label,)*$label";
# We must handle requests such as the following:
# http://.../REST/1.0/ticket/edit
# 4. http://.../REST/1.0/ticket/nn (all possibly with a single form).
# http://.../REST/1.0/ticket/nn/history
+# http://.../REST/1.0/ticket/nn/comment
# http://.../REST/1.0/ticket/nn/attachment/1
#
# Objects are specified by their type, and either a unique numeric ID,
# We won't pass $e through to compose, trusting instead that the
# handler added suitable comments for the user.
if ($e) {
- $status = "409 Syntax Error" if @$o;
+ if (@$o) {
+ $status = "409 Syntax Error";
+ }
+ else {
+ $status = "400 Bad Request";
+ }
push @output, [ $c, $o, $k ];
}
else {
$output = form_compose(\@output);
OUTPUT:
+$m->out("RT/".$RT::VERSION ." ".$status ."\n\n$output\n") if ($output || $status != 200);
+return;
</%INIT>
-RT/<% $RT::VERSION %> <% $status %>
-
-<% $output |n %>