Skip to content

Commit

Permalink
Ensure ASBQ custom attributes are urlencoded on delivery (#2923)
Browse files Browse the repository at this point in the history
Signed-off-by: Bernd Verst <[email protected]>
  • Loading branch information
berndverst authored Jun 20, 2023
1 parent 802221b commit 457f4e4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bindings/azure/servicebusqueues/servicebusqueues.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"context"
"errors"
"fmt"
"net/url"
"reflect"
"sync"
"sync/atomic"
Expand Down Expand Up @@ -178,7 +179,9 @@ func (a *AzureServiceBusQueues) getHandlerFn(handler bindings.Handler) impl.Hand
// Passthrough any custom metadata to the handler.
for key, val := range msg.ApplicationProperties {
if stringVal, ok := val.(string); ok {
metadata[key] = stringVal
// Escape the key and value to ensure they are valid URL query parameters.
// This is necessary for them to be sent as HTTP Metadata.
metadata[url.QueryEscape(key)] = url.QueryEscape(stringVal)
}
}

Expand Down

0 comments on commit 457f4e4

Please sign in to comment.