Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions components/nexusoperations/workflow/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,12 @@ func (ch *commandHandler) HandleScheduleCommand(
}

headerLength := 0
lowerCaseHeader := make(map[string]string, len(attrs.NexusHeader))
for k, v := range attrs.NexusHeader {
headerLength += len(k) + len(v)
if slices.Contains(ch.config.DisallowedOperationHeaders(), strings.ToLower(k)) {
lowerK := strings.ToLower(k)
lowerCaseHeader[lowerK] = v
headerLength += len(lowerK) + len(v)
if slices.Contains(ch.config.DisallowedOperationHeaders(), lowerK) {
return workflow.FailWorkflowTaskError{
Cause: enumspb.WORKFLOW_TASK_FAILED_CAUSE_BAD_SCHEDULE_NEXUS_OPERATION_ATTRIBUTES,
Message: fmt.Sprintf("ScheduleNexusOperationCommandAttributes.NexusHeader contains a disallowed header key: %q", k),
Expand Down Expand Up @@ -158,7 +161,7 @@ func (ch *commandHandler) HandleScheduleCommand(
Operation: attrs.Operation,
Input: attrs.Input,
ScheduleToCloseTimeout: attrs.ScheduleToCloseTimeout,
NexusHeader: attrs.NexusHeader,
NexusHeader: lowerCaseHeader,
RequestId: uuid.NewString(),
WorkflowTaskCompletedEventId: workflowTaskCompletedEventID,
},
Expand Down
Loading