[Rt-commit] rt branch, 4.0/bin-rt-content-type-backcompat, created. rt-4.0.14rc1-1-g6425b2c
Alex Vandiver
alexmv at bestpractical.com
Fri Jul 19 13:00:07 EDT 2013
The branch, 4.0/bin-rt-content-type-backcompat has been created
at 6425b2c9065844e3f55bad4a0f0675571051e395 (commit)
- Log -----------------------------------------------------------------
commit 6425b2c9065844e3f55bad4a0f0675571051e395
Author: Alex Vandiver <alexmv at bestpractical.com>
Date: Fri Jul 19 12:43:14 2013 -0400
Don't provide Content-Type if it is text/plain, for back-compat
Prior to af919ef, sending a "Content-Type" field would result in:
# Could not create ticket.
# Content-Type: Unknown field
As af919ef causes all bin/rt requests to send a Content-Type, this makes
it no longer interoperable with RT servers running versions prior to
4.0.14.
Preserve backwards compatibility by not sending the Content-Type field
if it is "text/plain".
diff --git a/bin/rt.in b/bin/rt.in
index ab54566..172a42a 100644
--- a/bin/rt.in
+++ b/bin/rt.in
@@ -665,8 +665,8 @@ EDIT:
# We'll let the user edit the form before sending it to the server,
# unless we have enough information to submit it non-interactively.
if ( $type && $type eq 'ticket' && $text !~ /^Content-Type:/m ) {
- $content_type ||= 'text/plain';
- $text .= "Content-Type: $content_type\n";
+ $text .= "Content-Type: $content_type\n"
+ if $content_type and $content_type ne "text/plain";
}
if ($edit || (!$input && !$cl)) {
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list