Fork me on GitHub
Drew Verlee00:05:02

When you make a request from your browser client, if you dont enable cors but you request to a different origin does the browser still make the request but not let you read the response? or does it just block the request? I would think the later, but i can't find a definitive answer.


The browser will make an OPTIONS request and if the response to that looks invalid, it will not issue the original (GET, POST, etc) request.

šŸ‘ 4

@drewverlee The result of the OPTIONS request is cached, so the browser doesn't have to make both requests every time.

Drew Verlee01:05:14

I'm aware of the browser issueing a preflight request in none simple (a defined set of rules). That's what you mean by options?

Drew Verlee01:05:00

Err, it must be different if it's cacheing it, the preflight is a separate request.


I mean literally an OPTIONS HTTP request.


The browser sends it automatically prior to a "non-simple" request for XHR. (edited to refer to simple/non-simple per the MDN link I posted below)


(that's what the "preflight" request is)


So the preflight check is: do we have recent cached permissions for this request? If not, send an OPTIONS request, and cache that result. Look in the cache for the permissions and either perform the original request or not.


(I can't remember exactly under what circumstances the browser does the preflight check, whether it's all types of requests or just "destructive" verbs -- I'd have to go look that up)


So some POST requests are not preflighted and some GET requests are. TIL: the subtleties of XHR šŸ™‚


(ah, so POST requests that are not preflighted would need to be independently protected by cross-site scripting detection etc)

Drew Verlee13:05:16

Gotcha. makes sense.


executable ASCII diagrams. e.g. a macro that takes an ASCII diagram and creates a state machine / control flow mechanism which can execute within a program. someone has had this idea before. my googling is failing. anyone know of such a thing?


i think racket has 2d macro forms


@dpsutton yess that is in a similar vein to what Iā€™m thinking of


Data specification and generation library for Elixir - this reminds me of schema/spec: