Skip to content

Commit

Permalink
parseAdapter(): make protocol matching more specific
Browse files Browse the repository at this point in the history
  • Loading branch information
alxndrsn committed Apr 29, 2024
1 parent 84b7afb commit 7454ea6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/node_modules/pouchdb-core/src/parseAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import PouchDB from './constructor';
import { guardedConsole, hasLocalStorage } from 'pouchdb-utils';

function parseAdapter(name, opts) {
var match = name.match(/([a-z-]*):\/\/(.*)/);
var match = name.match(/^([a-z-]*):\/\/(.*)$/);
if (match) {
// the http adapter expects the fully qualified name
return {
name: /https?/.test(match[1]) ? match[1] + '://' + match[2] : match[2],
name: /^https?$/.test(match[1]) ? match[1] + '://' + match[2] : match[2],
adapter: match[1]
};
}
Expand Down

0 comments on commit 7454ea6

Please sign in to comment.