Skip to content

Problem with signatures for query strings without values #65

@spiasecki

Description

@spiasecki

What is the correct way to generate the signature for requests with query string that has no key=value just a string without "=" sign for example https://domain/path?querystring

The service im connecting with for urls like that returns invalid signature error.
So who is not compliant with the RFC ? the service or the subscriber implementation ?

With one simple modification to the prepareParameters method i got the requests working, I can make a PR but i dont know it would be a valid change.

private function prepareParameters($data)
{
        // Parameters are sorted by name, using lexicographical byte value
        // ordering. Ref: Spec: 9.1.1 (1).
        uksort($data, 'strcmp');
        foreach ($data as $key => $value) {
            if ($value === null) {
//              unset($data[$key]); // current code
                $data[$key] = ""; // modification needed to make requests with a valid sig
            }
        }
        return $data;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions