mirror of
https://codeberg.org/keyoxide/doipjs.git
synced 2024-12-22 22:49:28 -07:00
fix: update lobste.rs URL syntax
This commit is contained in:
parent
a616dcd66d
commit
34ad2d718d
1 changed files with 12 additions and 4 deletions
|
@ -16,7 +16,7 @@ limitations under the License.
|
||||||
import * as E from '../enums.js'
|
import * as E from '../enums.js'
|
||||||
import { ServiceProvider } from '../serviceProvider.js'
|
import { ServiceProvider } from '../serviceProvider.js'
|
||||||
|
|
||||||
export const reURI = /^https:\/\/lobste\.rs\/u\/(.*)\/?/
|
export const reURI = /^https:\/\/lobste\.rs\/(:?~|u\/)(.*)\/?/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @function
|
* @function
|
||||||
|
@ -33,7 +33,7 @@ export function processURI (uri) {
|
||||||
},
|
},
|
||||||
profile: {
|
profile: {
|
||||||
display: match[1],
|
display: match[1],
|
||||||
uri,
|
uri: `https://lobste.rs/~${match[1]}`,
|
||||||
qr: null
|
qr: null
|
||||||
},
|
},
|
||||||
claim: {
|
claim: {
|
||||||
|
@ -42,11 +42,11 @@ export function processURI (uri) {
|
||||||
},
|
},
|
||||||
proof: {
|
proof: {
|
||||||
request: {
|
request: {
|
||||||
uri: `https://lobste.rs/u/${match[1]}.json`,
|
uri: `https://lobste.rs/~${match[1]}.json`,
|
||||||
fetcher: E.Fetcher.HTTP,
|
fetcher: E.Fetcher.HTTP,
|
||||||
accessRestriction: E.ProofAccessRestriction.NOCORS,
|
accessRestriction: E.ProofAccessRestriction.NOCORS,
|
||||||
data: {
|
data: {
|
||||||
url: `https://lobste.rs/u/${match[1]}.json`,
|
url: `https://lobste.rs/~${match[1]}.json`,
|
||||||
format: E.ProofFormat.JSON
|
format: E.ProofFormat.JSON
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -64,6 +64,10 @@ export function processURI (uri) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export const tests = [
|
export const tests = [
|
||||||
|
{
|
||||||
|
uri: 'https://lobste.rs/~Alice',
|
||||||
|
shouldMatch: true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
uri: 'https://lobste.rs/u/Alice',
|
uri: 'https://lobste.rs/u/Alice',
|
||||||
shouldMatch: true
|
shouldMatch: true
|
||||||
|
@ -72,6 +76,10 @@ export const tests = [
|
||||||
uri: 'https://lobste.rs/u/Alice/',
|
uri: 'https://lobste.rs/u/Alice/',
|
||||||
shouldMatch: true
|
shouldMatch: true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
uri: 'https://domain.org/~Alice',
|
||||||
|
shouldMatch: false
|
||||||
|
},
|
||||||
{
|
{
|
||||||
uri: 'https://domain.org/u/Alice',
|
uri: 'https://domain.org/u/Alice',
|
||||||
shouldMatch: false
|
shouldMatch: false
|
||||||
|
|
Loading…
Reference in a new issue