eugenezadorin / airtable-php

Simple PHP client for Airtable API
20 stars 7 forks source link

Invalid Request URI and table names #11

Open martinopic opened 4 months ago

martinopic commented 4 months ago

Currently when using a table name using a non valid URI string (e.g. $client->table('NAME WITH SPACE') ) an Exception is thrown when on Request::setUri method

in my opinion it should be Client responsability to automatically url encode table names that may easily contain non URI valid chars, line 122 sould be

$baseUri = sprintf('%s/%s/%s', self::BASE_URL, $this->databaseName, urlencode($this->tableName));

instead of

$baseUri = sprintf('%s/%s/%s', self::BASE_URL, $this->databaseName, $this->tableName);

martinopic commented 4 months ago

I correct myself: the function used should be rawurlencode and not urlencode as the encoding needed is RFC3986