Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Commit

Permalink
chore: revert the removal of originalUrl
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Burtey committed Aug 22, 2023
1 parent 29e5442 commit 739de47
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
9 changes: 4 additions & 5 deletions app/lnurlp/[username]/route.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NextResponse } from "next/server"
import { URL } from "url"
import originalUrl from "original-url"

import {
ApolloClient,
Expand Down Expand Up @@ -78,8 +78,7 @@ export async function GET(
) {
console.log(NOSTR_PUBKEY)

const { hostname } = new URL(request.url)

const url = originalUrl(request)
const username = params.username

const accountUsername = username ? username.toString() : ""
Expand Down Expand Up @@ -109,10 +108,10 @@ export async function GET(

const metadata = JSON.stringify([
["text/plain", `Payment to ${accountUsername}`],
["text/identifier", `${accountUsername}@${hostname}`],
["text/identifier", `${accountUsername}@${url.hostname}`],
])

const callback = `${request.url}/callback`
const callback = `${url.full}/callback`

return NextResponse.json({
callback,
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"lnurl-pay": "^1.0.1",
"lodash.debounce": "^4.0.8",
"next": "^13.4.19",
"original-url": "^1.2.3",
"react": "^18.2.0",
"react-bootstrap": "^1.6.4",
"react-currency-input-field": "^3.6.10",
Expand Down
12 changes: 12 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4158,6 +4158,11 @@ form-data@^4.0.0:
combined-stream "^1.0.8"
mime-types "^2.1.12"

forwarded-parse@^2.1.0:
version "2.1.2"
resolved "https://registry.npmjs.org/forwarded-parse/-/forwarded-parse-2.1.2.tgz#08511eddaaa2ddfd56ba11138eee7df117a09325"
integrity sha512-alTFZZQDKMporBH77856pXgzhEzaUVmLCDk+egLgIgHst3Tpndzz8MnKe+GzRJRfvVdn69HhpW7cmXzvtLvJAw==

fs-extra@^9.0.0:
version "9.1.0"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d"
Expand Down Expand Up @@ -5644,6 +5649,13 @@ ora@^5.4.1:
strip-ansi "^6.0.0"
wcwidth "^1.0.1"

original-url@^1.2.3:
version "1.2.3"
resolved "https://registry.npmjs.org/original-url/-/original-url-1.2.3.tgz#133aff4b2d27e38a98d736f7629c56262b7153e1"
integrity sha512-BYm+pKYLtS4mVe/mgT3YKGtWV5HzN/XKiaIu1aK4rsxyjuHeTW9N+xVBEpJcY1onB3nccfH0RbzUEoimMqFUHQ==
dependencies:
forwarded-parse "^2.1.0"

os-tmpdir@~1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274"
Expand Down

0 comments on commit 739de47

Please sign in to comment.