File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed
Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 11import { useMutation , UseMutationOptions } from '@tanstack/react-query'
2- import { constructHeaders , fetchHandler , handleError } from 'data/fetchers'
2+ import { fetchHandler , handleError } from 'data/fetchers'
33import { BASE_PATH } from 'lib/constants'
44import { toast } from 'sonner'
55
@@ -24,12 +24,9 @@ export type CheckCNAMERecordResponse = {
2424// [Joshen] Should tally with https://github.com/supabase/cli/blob/63790a1bd43bee06f82c4f510e709925526a4daa/internal/utils/api.go#L98
2525export async function checkCNAMERecord ( { domain } : CheckCNAMERecordVariables ) {
2626 try {
27- const headers = await constructHeaders ( { 'Content-Type' : 'application/json' } )
28- const res : CheckCNAMERecordResponse = await fetchHandler ( `${ BASE_PATH } /api/check-cname` , {
29- headers,
30- method : 'POST' ,
31- body : JSON . stringify ( { domain } ) ,
32- } ) . then ( ( res ) => res . json ( ) )
27+ const res : CheckCNAMERecordResponse = await fetchHandler (
28+ `${ BASE_PATH } /api/check-cname?domain=${ domain } `
29+ ) . then ( ( res ) => res . json ( ) )
3330
3431 if ( res . Answer === undefined ) {
3532 throw new Error (
Original file line number Diff line number Diff line change @@ -30,7 +30,10 @@ const HOSTED_SUPPORTED_API_URLS = [
3030]
3131
3232export function middleware ( request : NextRequest ) {
33- if ( IS_PLATFORM && ! HOSTED_SUPPORTED_API_URLS . some ( ( url ) => request . url . endsWith ( url ) ) ) {
33+ if (
34+ IS_PLATFORM &&
35+ ! HOSTED_SUPPORTED_API_URLS . some ( ( url ) => request . nextUrl . pathname . endsWith ( url ) )
36+ ) {
3437 return Response . json (
3538 { success : false , message : 'Endpoint not supported on hosted' } ,
3639 { status : 404 }
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import { CheckCNAMERecordResponse } from 'data/custom-domains/check-cname-mutati
22import { NextApiRequest , NextApiResponse } from 'next'
33
44const handler = async ( req : NextApiRequest , res : NextApiResponse ) => {
5- const { domain } = req . body
5+ const { domain } = req . query
66
77 try {
88 const result : CheckCNAMERecordResponse = await fetch (
You can’t perform that action at this time.
0 commit comments