Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
mgrubinger committed Dec 15, 2022
1 parent f85a472 commit 268902b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
20 changes: 10 additions & 10 deletions src/lib/Card.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
{#each Array.from({ length: 5 }) as star}★{/each}
</span>
<span class="stars stars-2" style:width="{(ratings / 5) * 100}%">
<span class="inner">
{#each Array.from({ length: 5 }) as star}★{/each}
</span>
<span class="inner">
{#each Array.from({ length: 5 }) as star}★{/each}
</span>
</span>
</span>
<span class="ratings_count">
Expand Down Expand Up @@ -101,11 +101,11 @@
position: absolute;
left: 20px;
top: 20px;
bottom: 120px;
bottom: 120px;
width: 65%;
z-index: 1;
align-items: flex-start;
justify-content: center;
justify-content: center;
}
.meta {
Expand Down Expand Up @@ -147,9 +147,9 @@
overflow: hidden;
color: rgb(243, 174, 0);
}
.stars-2 .inner {
position: absolute;
}
.stars-2 .inner {
position: absolute;
}
.ratings_count {
margin-left: 1rem;
Expand All @@ -160,8 +160,8 @@
color: #fff;
text-transform: uppercase;
font-size: 26px;
padding: 5px 12px ;
border-radius: 5px;
padding: 5px 12px;
border-radius: 5px;
font-weight: 600;
margin-top: 0.5rem;
}
Expand Down
10 changes: 6 additions & 4 deletions src/routes/og/+server.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ const width = 1200;
export const GET = async (event) => {
let searchParams = event.url.searchParams;

validateOrigin(event);
// validating origin
// TODO: this does not really work as we're not getting an origin from consuming applications AFAICT
// validateOrigin(event);

validateKey(searchParams.get('key'), searchParams.get('debug'));

Expand Down Expand Up @@ -93,12 +95,12 @@ function validateKey(keyFromUrlParams, debug) {
}

function validateOrigin(event) {
let allowed = false;
let allowed = false;
let allowlist = ['https://geizhals.at', 'https://geizhals.at'];
let origin = event.request.headers.get('origin');
console.log(origin);

if (origin == null) allowed = true;
if (allowlist.includes(origin)) allowed = true;

if(!allowed) throw error(405, `Not allowed. Invalid origin "${origin}".`);
if (!allowed) throw error(405, `Not allowed. Invalid origin "${origin}".`);
}
2 changes: 1 addition & 1 deletion src/styles/variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
--font-mono: 'Fira Mono', monospace;
font-family: var(--font-body);

--primary: #b900f1;
--primary: #b900f1;
}

1 comment on commit 268902b

@vercel
Copy link

@vercel vercel bot commented on 268902b Dec 15, 2022

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.