-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding no-ancestor http header to apps (so they're guaranteed to be at _top) #591
Conversation
@@ -11,7 +11,13 @@ namespace psibase | |||
{ | |||
std::string name; | |||
std::string value; | |||
|
|||
friend bool operator==(const HttpHeader& lhs, const HttpHeader& rhs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use = default
auto result = iface.serveSys(std::move(req)); | ||
if (result && !result->headers.empty() && serviceName != "common-sys") | ||
abortMessage("service " + service.str() + " attempted to set an http header"); | ||
|
||
if (reqTarget.size() == 0 || reqTarget.starts_with("/index.html")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you really mean starts_with
? ends_with
or ==
would make more sense to me.
HttpHeader frameAncestorHeader = {"Content-Security-Policy", "frame-ancestors 'none';"}; | ||
auto pos = std::find(result->headers.begin(), result->headers.end(), frameAncestorHeader); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will miss many valid ways to spell the header.
Also, if the service has already provided a different value of frame-ancestors
, do we still want to add frame-ancestors 'none'
?
No longer needed. |
No description provided.