Skip to content

if remote or remoteBaseUrl starts with a '/', prefix it with location.origin #121

@gr2m

Description

@gr2m

When my app runs at http://example.com and I run this code

var store = new Store('mydb', {
  remote: '/store/api/mydb'
})
store.sync()

Then store.sync() does not send AJAX requests to http://example.com/store/api/mydb, instead it syncs with another database in browser with the name '/store/api/mydb', which is rather confusing.

What we want is to check if the remote or remoteBaseUrl option starts with a /, and if it does, prefix it with location.origin

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