Open osbre opened 3 years ago
Maybe some dynamically-generated URLs whitelist
/api/publicpagedata return owner username, you can match owner username and filter it. But it will cost some time , I have tested it few days ago. It works, I will try to share in a few days. https://emindeniz99.com/Test-page-ad1f8ecc8f59404fa0a894f6af222a31 If a page is not belong to me, worker redirect to home page. ( It can show 404 page if you want ) https://github.com/emindeniz99/fruitionsite/tree/my-websites
The solution has a good alternative that fetches all possible pages and stores them in key-value store ( it is free now )
@emindeniz99 that's really cool solution! Thanks
This is easily fixed by setting the hostname to [YOUR NOTION DOAMIN]
instead of www.notion.so
in the fetchAndApply function. I haven't tested it extensively to see if it breaks anything, but it solves the problem of serving pages from other Notion sites.
async function fetchAndApply(request) {
if (request.method === 'OPTIONS') {
return handleOptions(request);
}
let url = new URL(request.url);
// CHANGE THIS...
// url.hostname = 'www.notion.so';
// To YOUR notion public domain...
url.hostname = 'simple10.notion.site';
...
}
For example, check this: https://fruitionsite.com//Test-page-ad1f8ecc8f59404fa0a894f6af222a31 https://amyrogers.design/Test-page-ad1f8ecc8f59404fa0a894f6af222a31 https://hunterheston.com/Test-page-ad1f8ecc8f59404fa0a894f6af222a31
These pages are not created by authors, but anyone can use it.
I found that
notion2site.com
andsuper.so
already solved this problem. I think there must be some solution, we'll need to figure out how to do that