Skip to content
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

Rebuild Response's public methods #126

Merged
merged 2 commits into from
Apr 22, 2024
Merged

Conversation

kanarus
Copy link
Member

@kanarus kanarus commented Apr 22, 2024

For more consistent names, and, some fangs like HTML layout fang:

struct LayoutFang;
impl FangAction for LayoutFang {
    async fn back<'b>(&'b self, res: &'b mut Response) {
        if res.headers.ContentType().is_some_and(|ct| ct.starts_with("text/html")) {
            let inner = res.drop_content();
            res.set_html(some_layout_fn(inner));
        }
    }
}

@kanarus kanarus merged commit fdc412c into main Apr 22, 2024
2 checks passed
@kanarus kanarus deleted the rebuild_response_public_methods branch April 22, 2024 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant