#Python HTTP Request Semi-Complete Headers

91 messages · Page 1 of 1 (latest)

ivory fractal
#

I'm working on taking my bot from my pc (development) and putting it onto your hosting service for implementation, but I'm having issues with http requests
for some reason, some parts of http headers aren't being received, e.g. "x-csrf-token"
Any idea what's up with this/how to fix it?
I remember having this issue in the past on a different server and having to make a ticket for support/to fix the issue, but don't remember exactly what had to be changed to fix it

rotund nexusBOT
#

@ivory fractal, you just advanced to level 2 !

grim whale
ivory fractal
#

sending

#

after testing for a while, my security cookie expires after the first request

#

everything works perfectly fine on my pc, but pebblehost returns a 401 (403 expected) and invalidates the cookie

grim whale
#

or?

ivory fractal
#

it's a post request to a url with a security cookie
that first request returns a 403 error which has a token in the header
I re-send the original request but with the error's header token in the header

grim whale
#

are you requesting an api or?

ivory fractal
#

a post request to an api, yes

grim whale
ivory fractal
#

no links

#

bruh

#

https ://groups .roblox. com/docs/index.html?urls.primaryName=Groups%20Api%20v1

grim whale
#

oh roblox

#

hmm

#

how does it want you to authenticate

ivory fractal
#

it's the 6th entry under Membership (v1/groups/{groupId}/join-requestss/users/{userId})

grim whale
ivory fractal
# grim whale how does it want you to authenticate

you send 1 request with a security cookie in the cookies section (roblosecurity)
it errors out with a 403 error, but that error has a token in the header called an "x-csrf-token"
you re-send the original request but with the aforementioned "x-csrf-token" in the header

#

roblosecurity has to be in as a cookie for both requests

#

again, no issues with my code since the code is literally the exact same on my pc and the server

grim whale
#

because that's not normal

ivory fractal
#

but I've been working with the api and been making bots with it for at least a year, maybe longer

grim whale
#

so your expecting a header to be returned

ivory fractal
#

yes

grim whale
#

instead what are you getting

ivory fractal
#

wow

#

ran a few prints

grim whale
#

I saw

#

ur getting a different response

ivory fractal
#

yes

grim whale
#

are you sure you are giving out the same code

ivory fractal
#

again, no difference between code

#

I literally used a site to compare text

#

they're identical apart from directories

grim whale
#

check the api docs to see what this reponse means, or ask their support if they know what you are doing wrong

ivory fractal
#

roblox doesn't exactly have support

grim whale
#

welp... check their docs

#

they should have an authenticated section

ivory fractal
#
Code    Description
200    
OK

400    
1: The group is invalid or does not exist.
3: The user is invalid or does not exist.
20: The group join request is invalid.

401    
0: Authorization has been denied for this request.

403    
0: Token Validation Failed
6: You are already in the maximum number of groups.
19: You have insufficient permissions for this request.

503    
18: The operation is temporarily unavailable. Please try again later.
ivory fractal
#

since it's the exact same code

#

it's an issue on pebblehost's end

grim whale
ivory fractal
#

I swear I remember having an issue like this before and I had to change some server settings or something

grim whale
#

it means that the server is acceping ur request

#

perhaps there is a rate limit on your ip or the api is blocking your ip

ivory fractal
#

well my ip is fine

#

so could pebble be getting ratelimited?

grim whale
#

but rate limits are usually 429

ivory fractal
#

yeah, what I'm thinking

grim whale
#

well you need to contact their support or see if there is a more specific description for this error code

ivory fractal
#

This is because you didn't provide a X-CSRF-Token header. It should give back a token in the response headers, so you can just pull it from there and retry the request with the token.

rotund nexusBOT
#

@ivory fractal, you just advanced to level 3 !

ivory fractal
#

simple google search says that

ivory fractal
#

yes

grim whale
#

so you should ask why you aren't getting one

#

also send your code

#

you might be doing smth wrong

ivory fractal
#

well no since everything works fine when I do it on my pc

#

that's the code from my pc

#

error is on line 300

grim whale
#

did you print el.headers

ivory fractal
#

yeah, I just removed it

ivory fractal
grim whale
ivory fractal
#

will do now

#

from my pc

#

1-3 are el, el.text & el.headers for the first request

#

the last three are the same for the second request

#

that's from the server

#

so it looks like pebblehost is somehow invalidating the security cookie

#

after once again comparing text, the only two differences are found in lines 11/12

#

obviously the issue hasn't been resolved, but I wanna thank you for being more helpful than the actual staff

#

since you're making an attempt

#

they should hire you lol

grim whale
#

well. I can't tell you much bcuz I don't use this api

#

but gl