fix: InvalidClientTokenId panic + VT defaults + Dockerfile config + hardcore tests (58/61)
- Add InvalidClientTokenId, ValidationError to SqsErrors (was causing panic: WriteHeader code 0) - Extract applyEnvironmentDefaults() with defer in LoadYamlConfig (VT=30 even without config file) - Dockerfile: copy goaws.yaml to /conf/, pass --config flag - Fix SendMessageBatch form parsing for AWS Query Protocol - Add hardcore_test.sh (61 tests, 14 groups) - Remove temp debug logs from delete_message.go
This commit is contained in:
@@ -230,8 +230,25 @@ type SendMessageBatchRequest struct {
|
||||
}
|
||||
|
||||
func (r *SendMessageBatchRequest) SetAttributesFromForm(values url.Values) {
|
||||
for entryIndex := range r.Entries {
|
||||
r.Entries[entryIndex].MessageAttributes = parseMessageAttributes(values, fmt.Sprintf("Entries.%d.MessageAttributes", entryIndex))
|
||||
// Парсим записи по AWS Query Protocol: SendMessageBatchRequestEntry.N.Id (1-based)
|
||||
// Gorilla/schema с дефолтными тегами ищет Entries.0.Id, что не соответствует AWS SQS API.
|
||||
for i := 1; ; i++ {
|
||||
id := values.Get(fmt.Sprintf("SendMessageBatchRequestEntry.%d.Id", i))
|
||||
if id == "" {
|
||||
break
|
||||
}
|
||||
entry := SendMessageBatchRequestEntry{
|
||||
Id: id,
|
||||
MessageBody: values.Get(fmt.Sprintf("SendMessageBatchRequestEntry.%d.MessageBody", i)),
|
||||
MessageDeduplicationId: values.Get(fmt.Sprintf("SendMessageBatchRequestEntry.%d.MessageDeduplicationId", i)),
|
||||
MessageGroupId: values.Get(fmt.Sprintf("SendMessageBatchRequestEntry.%d.MessageGroupId", i)),
|
||||
}
|
||||
ds := values.Get(fmt.Sprintf("SendMessageBatchRequestEntry.%d.DelaySeconds", i))
|
||||
if ds != "" {
|
||||
entry.DelaySeconds, _ = strconv.Atoi(ds)
|
||||
}
|
||||
entry.MessageAttributes = parseMessageAttributes(values, fmt.Sprintf("SendMessageBatchRequestEntry.%d.MessageAttribute", i))
|
||||
r.Entries = append(r.Entries, entry)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user