OHDSI / ROhdsiWebApi

An R package for interfacing with a WebAPI instance
https://ohdsi.github.io/ROhdsiWebApi
10 stars 17 forks source link

Remove trailing backslash from base URL #187

Closed ablack3 closed 3 years ago

ablack3 commented 3 years ago

Many ROhdsiWebApi functions take a base URL. If the base URL includes a trailing backslash then the api call will fail.

library(ROhdsiWebApi)
getWebApiVersion("https://atlas.ohdsi.org/WebAPI")
#> [1] "2.8.1"
getWebApiVersion("https://atlas.ohdsi.org/WebAPI/")
#> Error in getWebApiVersion("https://atlas.ohdsi.org/WebAPI/"): Please check if the url is valid. https://atlas.ohdsi.org/WebAPI/ . Failed while retrieving WebApi information.

Created on 2021-03-31 by the reprex package (v0.3.0)

Should ROhdsiWebApi automatically remove any trailing backshashes from a baseURL argument?

I think this would be not be difficult to implement but would require changes to every function that accepts a baseUrl which is a lot.

Are there any potential issues caused by removing trailing slashes from URLs?

gowthamrao commented 3 years ago

@azimov did you get to this yet :)

azimov commented 3 years ago

@gowthamrao see #191