Discuss Scratch

god286
Scratcher
1000+ posts

Scratchinfo - an epic website

I've got a big problem:
I need to fetch to /foo/bar for something.
So when I fetch to /foo/bar
the first / means the directory of the site right?
BUT it says “INVALID_URL”
But I have to fetch
http://localhost:3000/foo/bar
when the website is in production it won't work obviously

Can someone help?

Last edited by god286 (Nov. 18, 2021 00:15:33)


meowclient
Typescript and ESM support
Kind-of good documentation
Easy to use
meowclient


                 _ ____  ___   __   
__ _ ___ __| |___ \( _ ) / /_
/ _` |/ _ \ / _` | __) / _ \| '_ \
| (_| | (_) | (_| |/ __/ (_) | (_) |
\__, |\___/ \__,_|_____\___/ \___/
|___/
^ inspired by @Chiroyce, made with figlet
MagicCrayon9342
Scratcher
1000+ posts

Scratchinfo - an epic website

if you remove localhost, you just have :3000/foo/bar
of course thats an invalid URL

localhost is the address
you need it in the URL

signature
god286
Scratcher
1000+ posts

Scratchinfo - an epic website

MagicCrayon9342 wrote:

if you remove localhost, you just have :3000/foo/bar
of course thats an invalid URL

localhost is the address
you need it in the URL
I edited my question with a bit more information.
Your answer won't help… sorry
Also, ScratchInfo isn't on Localhost when you view it on the web.

Last edited by god286 (Nov. 18, 2021 00:16:57)


meowclient
Typescript and ESM support
Kind-of good documentation
Easy to use
meowclient


                 _ ____  ___   __   
__ _ ___ __| |___ \( _ ) / /_
/ _` |/ _ \ / _` | __) / _ \| '_ \
| (_| | (_) | (_| |/ __/ (_) | (_) |
\__, |\___/ \__,_|_____\___/ \___/
|___/
^ inspired by @Chiroyce, made with figlet
MagicCrayon9342
Scratcher
1000+ posts

Scratchinfo - an epic website

god286 wrote:

MagicCrayon9342 wrote:

if you remove localhost, you just have :3000/foo/bar
of course thats an invalid URL

localhost is the address
you need it in the URL
I edited my question with a bit more information.
Your answer won't help… sorry
Also, ScratchInfo isn't on Localhost when you view it on the web.
Localhost is, localhost. It is your ‘Local’ ‘Host’
Localhost is being served to an IP/Gateway. ScratchInfo has a domain. Also, without a domain. It would be viewable as your Public IP.
ScratchInfo IS on Localhost, port forwarded, and some stuff with the DNS server.

you might already know this idk

Last edited by MagicCrayon9342 (Nov. 18, 2021 00:29:11)


signature
god286
Scratcher
1000+ posts

Scratchinfo - an epic website

MagicCrayon9342 wrote:

god286 wrote:

MagicCrayon9342 wrote:

if you remove localhost, you just have :3000/foo/bar
of course thats an invalid URL

localhost is the address
you need it in the URL
I edited my question with a bit more information.
Your answer won't help… sorry
Also, ScratchInfo isn't on Localhost when you view it on the web.
Localhost is, localhost. It is your ‘Local’ ‘Host’
Localhost is being served to an IP/Gateway. ScratchInfo has a domain. Also, without a domain. It would be viewable as your Public IP.
ScratchInfo IS on Localhost, port forwarded, and some stuff with the DNS server.

im a nerd ik lmao
In this case I want it so that I dont need to add the localhost:port part

meowclient
Typescript and ESM support
Kind-of good documentation
Easy to use
meowclient


                 _ ____  ___   __   
__ _ ___ __| |___ \( _ ) / /_
/ _` |/ _ \ / _` | __) / _ \| '_ \
| (_| | (_) | (_| |/ __/ (_) | (_) |
\__, |\___/ \__,_|_____\___/ \___/
|___/
^ inspired by @Chiroyce, made with figlet
god286
Scratcher
1000+ posts

Scratchinfo - an epic website

I fixed it, but it's a very werid workaround (Rich harris plz fix)
let protocol = "https://"
if (request.host.startsWith("localhost:")) {
   protocol = "http://" // on localhost dont expect https
}
const fetchAddress = `${protocol}${request.host}/myThing`
ignore the thing getting angry at the `
yeah its a bad workaround but it works

Last edited by god286 (Nov. 18, 2021 02:01:09)


meowclient
Typescript and ESM support
Kind-of good documentation
Easy to use
meowclient


                 _ ____  ___   __   
__ _ ___ __| |___ \( _ ) / /_
/ _` |/ _ \ / _` | __) / _ \| '_ \
| (_| | (_) | (_| |/ __/ (_) | (_) |
\__, |\___/ \__,_|_____\___/ \___/
|___/
^ inspired by @Chiroyce, made with figlet
god286
Scratcher
1000+ posts

Scratchinfo - an epic website

ScratchLight works! But I don't know if it is secure… or if it can be hacked…

meowclient
Typescript and ESM support
Kind-of good documentation
Easy to use
meowclient


                 _ ____  ___   __   
__ _ ___ __| |___ \( _ ) / /_
/ _` |/ _ \ / _` | __) / _ \| '_ \
| (_| | (_) | (_| |/ __/ (_) | (_) |
\__, |\___/ \__,_|_____\___/ \___/
|___/
^ inspired by @Chiroyce, made with figlet
MagicCrayon9342
Scratcher
1000+ posts

Scratchinfo - an epic website

god286 wrote:

MagicCrayon9342 wrote:

god286 wrote:

MagicCrayon9342 wrote:

if you remove localhost, you just have :3000/foo/bar
of course thats an invalid URL

localhost is the address
you need it in the URL
I edited my question with a bit more information.
Your answer won't help… sorry
Also, ScratchInfo isn't on Localhost when you view it on the web.
Localhost is, localhost. It is your ‘Local’ ‘Host’
Localhost is being served to an IP/Gateway. ScratchInfo has a domain. Also, without a domain. It would be viewable as your Public IP.
ScratchInfo IS on Localhost, port forwarded, and some stuff with the DNS server.

im a nerd ik lmao
In this case I want it so that I dont need to add the localhost:port part
you don't have too, just use the domain. If you really need to test it without using the domain, you can just have a it open when you open Firefox. or have a bookmark. There is no working around using localhost:port, you can just do localhost if you set the port to a standard HTTPS port.

signature
god286
Scratcher
1000+ posts

Scratchinfo - an epic website

MagicCrayon9342 wrote:

-snip-
you don't have too, just use the domain. If you really need to test it without using the domain, you can just have a it open when you open Firefox. or have a bookmark. There is no working around using localhost:port, you can just do localhost if you set the port to a standard HTTPS port.
I already have a solution, but thanks

meowclient
Typescript and ESM support
Kind-of good documentation
Easy to use
meowclient


                 _ ____  ___   __   
__ _ ___ __| |___ \( _ ) / /_
/ _` |/ _ \ / _` | __) / _ \| '_ \
| (_| | (_) | (_| |/ __/ (_) | (_) |
\__, |\___/ \__,_|_____\___/ \___/
|___/
^ inspired by @Chiroyce, made with figlet
MagicCrayon9342
Scratcher
1000+ posts

Scratchinfo - an epic website

god286 wrote:

MagicCrayon9342 wrote:

-snip-
you don't have too, just use the domain. If you really need to test it without using the domain, you can just have a it open when you open Firefox. or have a bookmark. There is no working around using localhost:port, you can just do localhost if you set the port to a standard HTTPS port.
I already have a solution, but thanks
Also, constantly worrying about something being ‘hacked’ is pretty dumb. Everything has security vulnerabilities, so it's not worth it.

signature
kccuber
Scratcher
1000+ posts

Scratchinfo - an epic website

god286 wrote:

ScratchLight works! But I don't know if it is secure… or if it can be hacked…
uhh just a question, but what's scratchlight?


Made using Nord Theme & Inkscape
god286
Scratcher
1000+ posts

Scratchinfo - an epic website

kccuber wrote:

god286 wrote:

ScratchLight works! But I don't know if it is secure… or if it can be hacked…
uhh just a question, but what's scratchlight?
uhh its my auth thing which supports comments and will be enabled soon

meowclient
Typescript and ESM support
Kind-of good documentation
Easy to use
meowclient


                 _ ____  ___   __   
__ _ ___ __| |___ \( _ ) / /_
/ _` |/ _ \ / _` | __) / _ \| '_ \
| (_| | (_) | (_| |/ __/ (_) | (_) |
\__, |\___/ \__,_|_____\___/ \___/
|___/
^ inspired by @Chiroyce, made with figlet
god286
Scratcher
1000+ posts

Scratchinfo - an epic website

test out scratchlight today
https://scratchinfo.vercel.app/
yay

Last edited by god286 (Nov. 19, 2021 00:12:14)


meowclient
Typescript and ESM support
Kind-of good documentation
Easy to use
meowclient


                 _ ____  ___   __   
__ _ ___ __| |___ \( _ ) / /_
/ _` |/ _ \ / _` | __) / _ \| '_ \
| (_| | (_) | (_| |/ __/ (_) | (_) |
\__, |\___/ \__,_|_____\___/ \___/
|___/
^ inspired by @Chiroyce, made with figlet
JoshAtticus
Scratcher
100+ posts

Scratchinfo - an epic website

god286 wrote:

I've got a big problem:
I need to fetch to /foo/bar for something.
So when I fetch to /foo/bar
the first / means the directory of the site right?
BUT it says “INVALID_URL”
But I have to fetch
http://localhost:3000/foo/bar
when the website is in production it won't work obviously

Can someone help?
Remove the "http://" part, localhost and http are different protocols

~~I'm JoshAtticus!~~
I enjoy scratching, playing with tech and online privacy(not google)
This account is in archived state, I don't post projects here, and I might not be very active with comments and forums
I have 2 new accounts: @OSMANiC Team & @OSMANiCBetas



^^Made with Figlet^^










JoshAtticus
Scratcher
100+ posts

Scratchinfo - an epic website

I have a problem w/ the You page, I go to the authenticator and complete it, however scratch info then says Invalid Authentication

~~I'm JoshAtticus!~~
I enjoy scratching, playing with tech and online privacy(not google)
This account is in archived state, I don't post projects here, and I might not be very active with comments and forums
I have 2 new accounts: @OSMANiC Team & @OSMANiCBetas



^^Made with Figlet^^










god286
Scratcher
1000+ posts

Scratchinfo - an epic website

JoshAtticus wrote:

I have a problem w/ the You page, I go to the authenticator and complete it, however scratch info then says Invalid Authentication
Hmm.. thats weird. can you log network when you go to the you page
maybe try to go to the Scratchlight login https://scratchinfo-git-scratchlight-webdev03.vercel.app/dashboard

Last edited by god286 (Nov. 18, 2021 06:51:16)


meowclient
Typescript and ESM support
Kind-of good documentation
Easy to use
meowclient


                 _ ____  ___   __   
__ _ ___ __| |___ \( _ ) / /_
/ _` |/ _ \ / _` | __) / _ \| '_ \
| (_| | (_) | (_| |/ __/ (_) | (_) |
\__, |\___/ \__,_|_____\___/ \___/
|___/
^ inspired by @Chiroyce, made with figlet
JoshAtticus
Scratcher
100+ posts

Scratchinfo - an epic website

god286 wrote:

JoshAtticus wrote:

I have a problem w/ the You page, I go to the authenticator and complete it, however scratch info then says Invalid Authentication
Hmm.. thats weird. can you log network when you go to the you page
maybe try to go to the Scratchlight login https://scratchinfo-git-scratchlight-webdev03.vercel.app/dashboard
Yes

~~I'm JoshAtticus!~~
I enjoy scratching, playing with tech and online privacy(not google)
This account is in archived state, I don't post projects here, and I might not be very active with comments and forums
I have 2 new accounts: @OSMANiC Team & @OSMANiCBetas



^^Made with Figlet^^










Chiroyce
Scratcher
1000+ posts

Scratchinfo - an epic website

If you fetch “/foo/bar” on localhost:3000, it will default to
http://localhost:3000/foo/bar
if you do it on https://example.com, it will default to
https://example.com/foo/bar

Last edited by Chiroyce (Nov. 18, 2021 08:37:27)








April Fools' topics:
New Buildings in Scratch's headquarters
Give every Scratcher an M1 MacBook Air
Scratch should let users edit other Scratchers' projects
Make a statue for Jeffalo
Scratch Tech Tips™
Make a Chiroyce statue emoji


<img src=“x” onerror=“alert('XSS vulnerability discovered')”>

this is a test sentence
god286
Scratcher
1000+ posts

Scratchinfo - an epic website

Chiroyce wrote:

If you fetch “/foo/bar” on localhost:3000, it will default to
http://localhost:3000/foo/bar
if you do it on https://example.com, it will default to
https://example.com/foo/bar
But that's not the behaviour in SvelteKit endpoints, so I used a workaround #286 to fix it.
Edit: So fitting, that post is number #286 hah

Last edited by god286 (Nov. 18, 2021 08:39:12)


meowclient
Typescript and ESM support
Kind-of good documentation
Easy to use
meowclient


                 _ ____  ___   __   
__ _ ___ __| |___ \( _ ) / /_
/ _` |/ _ \ / _` | __) / _ \| '_ \
| (_| | (_) | (_| |/ __/ (_) | (_) |
\__, |\___/ \__,_|_____\___/ \___/
|___/
^ inspired by @Chiroyce, made with figlet
god286
Scratcher
1000+ posts

Scratchinfo - an epic website

300th post! WOOHOO
Thanks everyone! It's been fun

meowclient
Typescript and ESM support
Kind-of good documentation
Easy to use
meowclient


                 _ ____  ___   __   
__ _ ___ __| |___ \( _ ) / /_
/ _` |/ _ \ / _` | __) / _ \| '_ \
| (_| | (_) | (_| |/ __/ (_) | (_) |
\__, |\___/ \__,_|_____\___/ \___/
|___/
^ inspired by @Chiroyce, made with figlet

Powered by DjangoBB

Standard | Mobile