Skip to content

Bug: OAuth1 signature fails with array parameters due to double encoding #12

@Bikash-bluebash

Description

@Bikash-bluebash

Description

When using array parameters like 'includes[]': %w[value1 value2] in requests, the OAuth1 signature calculation fails with a 401 unauthorized error. This happens because the square brackets ([]) are being double-encoded in the signature base string.

Problem Details

The signature base string was incorrectly encoding includes[] as includes%255B%255D instead of the correct includes%5B%5D. This double encoding (%25 is the encoding for %) causes the server to reject the signature.

Steps to Reproduce

  1. Make a request with parameters including an array:
request(:get, 'example/endpoint',
  params: {
    param1: 'value1',
    'includes[]': %w[value1 value2]
  }
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions