elli-lib / elli

Simple, robust and performant Erlang web server
https://github.com/elli-lib/elli/blob/develop/doc/README.md
MIT License
314 stars 37 forks source link

Exposing additional functions for external use #98

Closed jeffgrunewald closed 3 years ago

jeffgrunewald commented 3 years ago

Closes https://github.com/elli-lib/elli/issues/97 by making some existing functions accessible to external library users, particularly libraries operating with a handler in handover mode where the responses will be manually constructed by the implementing application or library.

elli_http:send_file/5 - mirrors the already public elli_http:send_response/4 for sending file content elli_http:close_or_keepalive/4 - manually handle responses with the correct keepalive setting based on the req

paulo-ferraz-oliveira commented 3 years ago

Hey, @jeffgrunewald. If you use "Closes" instead of "Addresses" (initial stuff in description) the Issue gets linked automatically and will get closed with the pull request.

yurrriq commented 3 years ago

This seems fine to export to me. Might be good to add an example of usage in https://github.com/elli-lib/elli-examples

codecov-io commented 3 years ago

Codecov Report

Merging #98 (7c8535c) into main (3fa6faa) will increase coverage by 0.19%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #98      +/-   ##
==========================================
+ Coverage   76.24%   76.43%   +0.19%     
==========================================
  Files          12       12              
  Lines         766      764       -2     
==========================================
  Hits          584      584              
+ Misses        182      180       -2     
Impacted Files Coverage Δ
src/elli_http.erl 68.35% <100.00%> (+0.34%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 3fa6faa...7c8535c. Read the comment docs.