RubenVerborgh / solid-server-architecture

Proposed architecture for a Solid server
https://rubenverborgh.github.io/solid-server-architecture/solid-architecture-v1-3-0.pdf
13 stars 2 forks source link

Should my code be able to access HTTP headers, cookies, query params? #9

Closed pmcb55 closed 5 years ago

pmcb55 commented 5 years ago

The constructor for LdpOperation takes 'constructor({ store, target, body, parsedBody })', so should executed code never have access to HTTP headers (like 'Accept-Language' for instance), or cookies, or query params that may also have been part of an incoming HTTP request?

RubenVerborgh commented 5 years ago

The constructor for LdpOperation takes 'constructor({ store, target, body, parsedBody })'

Just want to mention that this implementation is draft/inspirational, so signatures are not necessarily complete. (Left an ellipsis on the architectural diagram for that very reason, you got me 😄)

so should executed code never have access to HTTP headers (like 'Accept-Language' for instance), or cookies, or query params that may also have been part of an incoming HTTP request?

It's up to the parser to break down the request into a parsed object; Operations should not depend on HTTP syntax in any way. Especially content preferences (in multiple dimensions) should be part of the options passed to LdpOperation, cfr. https://github.com/RubenVerborgh/solid-server-architecture/issues/4#issuecomment-490967242.