From 1712735d0a7c2c29b1b7a63a9e463aee1a15df19 Mon Sep 17 00:00:00 2001 From: Nic Pottier Date: Thu, 15 Feb 2018 11:13:44 -0500 Subject: [PATCH] correct parameter names for mtarget multiparts --- handlers/mtarget/mtarget.go | 10 +++++----- handlers/mtarget/mtarget_test.go | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/handlers/mtarget/mtarget.go b/handlers/mtarget/mtarget.go index 17887d5c4..248909852 100644 --- a/handlers/mtarget/mtarget.go +++ b/handlers/mtarget/mtarget.go @@ -70,17 +70,17 @@ func (h *handler) receiveMsg(ctx context.Context, c courier.Channel, w http.Resp // if we have a long message id, then this is part of a multipart message, we don't write the message until // we have received all parts, which we buffer in Redis - longID := r.Form.Get("msglong_id") + longID := r.Form.Get("msglong.id") if longID != "" { - longCount, _ := strconv.Atoi(r.Form.Get("msglong_msgcount")) - longRef, _ := strconv.Atoi(r.Form.Get("msglong_msgref")) + longCount, _ := strconv.Atoi(r.Form.Get("msglong.msgcount")) + longRef, _ := strconv.Atoi(r.Form.Get("msglong.msgref")) if longCount == 0 || longRef == 0 { - return nil, courier.WriteAndLogRequestError(ctx, w, r, c, fmt.Errorf("invalid or missing 'msglong_msgcount' or 'msglong_msgref' parameters")) + return nil, courier.WriteAndLogRequestError(ctx, w, r, c, fmt.Errorf("invalid or missing 'msglong.msgcount' or 'msglong.msgref' parameters")) } if longRef < 1 || longRef > longCount { - return nil, courier.WriteAndLogRequestError(ctx, w, r, c, fmt.Errorf("'msglong_msgref' needs to be between 1 and 'msglong_msgcount' inclusive")) + return nil, courier.WriteAndLogRequestError(ctx, w, r, c, fmt.Errorf("'msglong.msgref' needs to be between 1 and 'msglong.msgcount' inclusive")) } rc := h.Backend().RedisPool().Get() diff --git a/handlers/mtarget/mtarget_test.go b/handlers/mtarget/mtarget_test.go index 8efaa2f7e..aadbdd915 100644 --- a/handlers/mtarget/mtarget_test.go +++ b/handlers/mtarget/mtarget_test.go @@ -15,8 +15,8 @@ var ( receiveStop = "Msisdn=+923161909799&Content=Stop&Keyword=Stop" receiveMissingFrom = "Content=hello&Keyword=Default" - receivePart2 = "Msisdn=+923161909799&Content=world&Keyword=Default&msglong_id=longmsg&msglong_msgcount=2&msglong_msgref=2" - receivePart1 = "Msisdn=+923161909799&Content=hello+&Keyword=Default&msglong_id=longmsg&msglong_msgcount=2&msglong_msgref=1" + receivePart2 = "Msisdn=+923161909799&Content=world&Keyword=Default&msglong.id=longmsg&msglong.msgcount=2&msglong.msgref=2" + receivePart1 = "Msisdn=+923161909799&Content=hello+&Keyword=Default&msglong.id=longmsg&msglong.msgcount=2&msglong.msgref=1" statusURL = "/c/mt/8eb23e93-5ecb-45ba-b726-3b064e0c56ab/status"