HNHacker News
TopNewBestAskShowJobs

elbajo

122 karma · joined March 23, 2021

www.adrien-pajot.com
submissionscomments
elbajo··on Next.js GET Cache Bypass via Multipart POST – Reproduces on Vercel.com
Hosting a Next.js app and ever wondered why you see POST requests returning 200 on an endpoint that only support GET? Probably not but it got me curious today. Turns out it might be increasing your hosting cost.

You can reproduce this against Vercel's own homepage:

curl -iX POST https://vercel.com -F 'payload={"message":"Testing multipart form data POST"}' | less

=>

HTTP/2 200 [...] x-powered-by: Next.js, Payload x-vercel-cache: BYPASS

<!DOCTYPE html><html class=...

=> Returns 200, cache is bypassed. Should be 405.

The behavior is also weird where the hosting type (dev, prod local, prod) matters as well as the type of POST request.

Link to my findings: https://github.com/vercel/next.js/issues/78070#issuecomment-...

elbajo··on Zod 4
Great to hear this is something you are considering!

To be clear: this isn't my library. This is just something I found while trying to solve the FormData issue. Props go to https://github.com/raflymln who created it.

elbajo··on Zod 4
First thank you for the hard work, many of my local hacks will go away with the new features!

As a convenience and mostly avoid typos in form names I use my own version of https://github.com/raflymln/zod-key-parser. I've been surprised something like this hasn't been implemented directly in the library.

Curious if you think this is out of scope for Zod or just something you haven't gotten around to implement?

(Here are discussions around it: https://github.com/colinhacks/zod/discussions/2134)

elbajo··on Bald eagles are thriving again after near extinction
I'm also on Lake Sammamish and have a couple bald eagles living on a tree next to the house! A bit random but if you ever want to meet up, I will be there May-June this year :)
elbajo··on I pulled data on 1378 restaurants from Google Maps to rank them in order
Well not exactly a "product" ahah more of a proof of concept. It doesn't make any money (never intended to) and I moved on to other side projects so I do not have time to maintain anymore.
elbajo··on I pulled data on 1378 restaurants from Google Maps to rank them in order
Hi Matt! I did something similar for https://sweetspots.fr/ it would get updated every week and was very helpful for discovering cities.

I stopped maintaining the project 1 year ago so the list are getting stale now but it was fun while it lasted. Glad to see someone else look into this!

elbajo··on Show HN: Val Town – A Cloud Scripting Site
Big fan of the idea!

I've been using Google Apps Script[1] for similar use cases but the limited feature set has been frustrating. Glad to see something more modern come up!

I wonder if HTML parsing is possible since there isn't npm support to import a parser yet. Maybe by dropping the parser as a separate val?

[1] - https://www.google.com/script/start/

elbajo··on JSON Crack – Visualize JSON data into graphs
Ideally this is something that could run locally but it looks great thank you!

I wish these kind of projects would show up when searching "Online JSON visualization". Current SEO logic means that website like this have pretty much no chance of making it. Would love to be proven wrong though!

elbajo··on Web scraping via JavaScript runtime heap snapshots
Love this approach, thanks for sharing!

I am trying this on a website for which Puppeteer has trouble loading so I got a heap snapshot directly in Chrome. I was trying to search for relevant objects directly in the Chrome heap viewer but I don't think the search looks inside objects.

I think your tool would work: "puppeteer-heap-snapshot query -f /tmp/file.heapsnapshot -p property1" or really any JSON parser but it requires extra steps. Would you say this is the easiest way to view/debug a heap snapshot?

elbajo··on Facebook Messenger blocks messages containing “di.wang”
Still broken when trying to send to the same contact. Also tried with a German VPN and same result.

What's super interesting though is that from what I can see it sends fine to my EU contacts but not to US contacts. I don't want to spam all my friends so I can't collect too many data points.

elbajo··on Facebook Messenger blocks messages containing “di.wang”
Would be curious to hear how something like this happens.

My first guess was that the domain was part of a FB deny list but I don't see why it would. It's still up for grabs https://www.whois.com/whois/di.wang and I can't find any history on https://web.archive.org/web/*/http://di.wang/\\*.

Context is that this is part of an email address and my friend can't send their email anymore.

elbajo··on Show HN: Meetup with other travelers in a new place
Love the idea! I've been using Couchsurfing for many years and tried their "hangout" feature a few times. It's 95% males harassing traveling women that happen to log in but the 5% left can be great to meet and I've had great experiences. Hopefully you find a way to navigate away from that even as you get more users.
elbajo··on This Music Video Does Not Exist [video]
It's picking a random video out of 14: ${urls[urls.length * Math.random() | 0]}

With the list loaded as an asset: urls = ["Spu3eiOEJ-M", "BE2lZ-Ti1Wc", "lHpcYPfjiLs", "6w2WXRFJpAE", "jPBgu-IO6TI", "g4px8cFR3gc", "whD78YCQXoo", "4iN9738uASY", "2tSa701EftM", "hjinBNYEkb8", "jckJS8RNMbw", "gq5EQtSiJiE", "zhV3ecScgrA", "wVnt_CX0C64"]