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
- Make a request with parameters including an array:
request(:get, 'example/endpoint',
params: {
param1: 'value1',
'includes[]': %w[value1 value2]
}
)