OpenFn / adaptors

The new home for OpenFn adaptors; re-usable connectors for the most common DPGs and DPI building blocks.
GNU General Public License v3.0
4 stars 8 forks source link

odk: better URL building #648

Closed josephjclark closed 1 week ago

josephjclark commented 1 week ago

ODK currently uses its own convoluted and ineffective URL builder:

 const url = `${baseUrl}/${removeLeadingSlash(path)}`;

  return commonRequest(method, url, options).then(logResponse);

But really we should be passing the baseURL and path into the common request, and let undici handle the URL for us. Like the auth function does

This makes us more robust with trailing slashes in baseURL (it should work with or without a trailing slash)