Skip to content

Commit

Permalink
Fix Whois failing to load ✅
Browse files Browse the repository at this point in the history
  • Loading branch information
wotschofsky committed Nov 5, 2023
1 parent a02181e commit 7875988
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions app/lookup/[domain]/whois/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import whoiser, { type WhoisSearchResult } from 'whoiser';
const lookupWhois = async (domain: string) => {
const result = await whoiser(domain, {
raw: true,
timeout: 3000,
timeout: 5000,
});

const mappedResults: Record<string, string> = {};
Expand All @@ -28,16 +28,20 @@ const WhoisResultsPage: FC<WhoisResultsPageProps> = async ({

return (
<>
{Object.keys(data).map((key) => (
<Fragment key={key}>
<h2 className="mb-4 mt-8 text-3xl font-bold tracking-tight">{key}</h2>
<code>
{data[key].split('\n').map((line, index) => (
<p key={index}>{line}</p>
))}
</code>
</Fragment>
))}
{Object.entries(data)
.filter(([_key, value]) => Boolean(value))
.map(([key, value]) => (
<Fragment key={key}>
<h2 className="mb-4 mt-8 text-3xl font-bold tracking-tight">
{key}
</h2>
<code>
{value.split('\n').map((line, index) => (
<p key={index}>{line}</p>
))}
</code>
</Fragment>
))}
</>
);
};
Expand Down

1 comment on commit 7875988

@vercel
Copy link

@vercel vercel bot commented on 7875988 Nov 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.