Need a way to set headers when responding to an http-request
tracked
Bavid Dailey
the webserver in SLS is missing some important abilities that are part of the http standard. I understand that there is a proxy server between my LSL webserver and the external internet, and therefore some restrictions must apply.
But the omissions I have fallen over recently are not onerous for proxy server. For example
- basic realm authorisation
- setting cookies
- returning a redirect status
These 3 require being able to set stock standard HTTP headers in the generated response , as is done by llSetContentType for the CONTENT_TYPE header.
I'd also like to be able to do chunked responses. I accept that's a bit more ambitious
So my request boils down to
Please provide a function llSetHeader for at good subset of the standard HTTP headers. It should function with the same constraints as llSetContentType does.
Log In
Spidey Linden
Merged in a post:
Allow llGetHTTPHeader for http_response
Coyote Enthusiast
Headers are important when processing requests. It'd be really useful if we can get the requests from a HTTP response.
Currently we can do this with http_request, but not http_response. Not entirely sure why.
EG:
http_response(key id, integer status, list meta, string data)
{
if(llGetHTTPHeader(id, "Content-Type") == "application/json")
{
llOwnerSay("Server says: "+llGetJsonValue(data, ["status"]));
}
else
{
llOwnerSay("I have no idea what the server is trying to say...");
}
}
Spidey Linden
marked this post as
tracked
Issue tracked. We have no estimate when it may be implemented. Please see future updates here.
SL Feedback
Hello, and thank you for your feature request regarding the ability to use llGetHTTPHeader in the http_response event. This feature has been previously brought up in our Jira archive. We understand the importance of accessing headers when processing HTTP responses, and this request will now be tracked. We have no estimate when it may be implemented, but please stay tuned for future updates. Thank you for your continued commitment to improving Second Life.