@nxtedition/lib 23.5.12 → 23.5.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/couch.js +6 -1
- package/http.js +5 -0
- package/package.json +1 -1
package/couch.js
CHANGED
|
@@ -7,6 +7,7 @@ import { defaultDelay as delay } from './http.js'
|
|
|
7
7
|
import urljoin from 'url-join'
|
|
8
8
|
import { AbortError } from './errors.js'
|
|
9
9
|
import { dispatch, Agent, Pool, request as undiciRequest } from '@nxtedition/nxt-undici'
|
|
10
|
+
import urlJoin from 'url-join'
|
|
10
11
|
|
|
11
12
|
export function makeCouch(opts) {
|
|
12
13
|
let config
|
|
@@ -254,7 +255,7 @@ export function makeCouch(opts) {
|
|
|
254
255
|
const query = { ...params, feed: live ? 'continuous' : 'normal' }
|
|
255
256
|
|
|
256
257
|
const ureq = {
|
|
257
|
-
path:
|
|
258
|
+
path: urlJoin(dbPathname, '/_changes'),
|
|
258
259
|
origin: dbOrigin,
|
|
259
260
|
query,
|
|
260
261
|
headers: body
|
|
@@ -1067,6 +1068,10 @@ export function request(url, opts) {
|
|
|
1067
1068
|
|
|
1068
1069
|
url = opts.url
|
|
1069
1070
|
|
|
1071
|
+
if (typeof url === 'string') {
|
|
1072
|
+
url = new URL(url)
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1070
1075
|
let origin = url.origin
|
|
1071
1076
|
if (!origin) {
|
|
1072
1077
|
const protocol = url.protocol ?? 'http:'
|
package/http.js
CHANGED