@atproto/xrpc-server 0.4.1 → 0.4.2
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/CHANGELOG.md +7 -0
- package/dist/index.js +9 -11
- package/dist/index.js.map +2 -2
- package/package.json +3 -3
- package/src/server.ts +3 -5
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -43596,13 +43596,13 @@ var ensureValidAtUri = (uri2) => {
|
|
|
43596
43596
|
throw new Error("ATURI requires at least method and authority sections");
|
|
43597
43597
|
}
|
|
43598
43598
|
try {
|
|
43599
|
-
|
|
43600
|
-
} catch {
|
|
43601
|
-
try {
|
|
43599
|
+
if (parts[2].startsWith("did:")) {
|
|
43602
43600
|
ensureValidDid(parts[2]);
|
|
43603
|
-
}
|
|
43604
|
-
|
|
43601
|
+
} else {
|
|
43602
|
+
ensureValidHandle(parts[2]);
|
|
43605
43603
|
}
|
|
43604
|
+
} catch {
|
|
43605
|
+
throw new Error("ATURI authority must be a valid handle or DID");
|
|
43606
43606
|
}
|
|
43607
43607
|
if (parts.length >= 4) {
|
|
43608
43608
|
if (parts[3].length == 0) {
|
|
@@ -44938,7 +44938,7 @@ function datetime(path, value) {
|
|
|
44938
44938
|
} catch {
|
|
44939
44939
|
return {
|
|
44940
44940
|
success: false,
|
|
44941
|
-
error: new ValidationError(`${path} must be an
|
|
44941
|
+
error: new ValidationError(`${path} must be an valid atproto datetime (both RFC-3339 and ISO-8601)`)
|
|
44942
44942
|
};
|
|
44943
44943
|
}
|
|
44944
44944
|
return { success: true, value };
|
|
@@ -52923,11 +52923,9 @@ var Server = class {
|
|
|
52923
52923
|
req,
|
|
52924
52924
|
res
|
|
52925
52925
|
};
|
|
52926
|
-
|
|
52927
|
-
|
|
52928
|
-
|
|
52929
|
-
return next(result);
|
|
52930
|
-
}
|
|
52926
|
+
const result = await consumeRateLimit(reqCtx);
|
|
52927
|
+
if (result instanceof RateLimitExceededError) {
|
|
52928
|
+
return next(result);
|
|
52931
52929
|
}
|
|
52932
52930
|
const outputUnvalidated = await handler(reqCtx);
|
|
52933
52931
|
if (isHandlerError(outputUnvalidated)) {
|