-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Buggy resource path resolution #52
Comments
Merged
@roll another (show stopper bug) is that you do:
This leads to errors if your base path is a http url since
I think this is fixed in #48 |
roll
pushed a commit
that referenced
this issue
Jan 24, 2017
* Handle relative resource paths for URLs * Add remote relative resource path test * Don't prepend base path if the resource path is URL * New datapackage for remote resource URL tests * Make _getBasePath static * Add _getBasePath tests * Add source getter tests * Add new data fixtures * Add checkPath method * Implement path validation logic * Change validate return value to [] if valid * Tests for basePath defaults and validation * Add explanation for basePath * Always throw error if basePath is invalid * Correct comments * Rename Resource.typeOfResourcePath to Resource.type * Change validate return value to true * Adjust tests to expect true from Profile.validate
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://github.com/frictionlessdata/datapackage-js/blob/master/src/resource.js#L73
This is not the right logic: we need to check whether resource
path
attribute is a fully qualified url or not before prepending the basepath - we only prepend base ifpath
is not a fully qualified url.Aside: as general code practice i think this should be an if / else statement not if then a return - the logic flow would be clearer.
Aside:
type
as a function seems a too generic name -- typeOfResourcePath would be a more informative name and would obviate much of the documentation ;-)The text was updated successfully, but these errors were encountered: