-
Notifications
You must be signed in to change notification settings - Fork 21
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
Update web hosting api to handle splited transaction #374
Update web hosting api to handle splited transaction #374
Conversation
defp encode_res(conn, file_content, encodage) do | ||
accept_encoding = get_req_header(conn, "accept-encoding") | ||
|
||
case !Enum.empty?(accept_encoding) and |
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.
I think you can simplify using simple case:
case get_req_header(conn, "accept_encoding") do
[] ->
# Do something when it's empty
accept_encoding ->
# Do something when it's not empty
end
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.
Yes but there will be code duplication because we have the same action to do when accept_encoding is empty and when it is not empty but don't contain "gzip"
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.
You can use with
statement to chain conditions
Description
This PR updates web_hosting API to handle files with their content in another transaction(s).
Fixes #340
Type of change
How Has This Been Tested?
Tested with Archethic Website sent by aeweb cli.
Also add tests in test files
To test, refer to archethic-foundation/aeweb-cli#64
Checklist: