This repository was archived by the owner on May 25, 2021. It is now read-only.
Merged
Conversation
| before_response(Req0, Code0, Headers0, Args0) -> | ||
| chttpd_plugin:before_response(Req0, Code0, Headers0, Args0). | ||
|
|
||
| respond_(#httpd{mochi_req = MochiReq}, Code, Headers, _Args, start_response) -> |
Member
There was a problem hiding this comment.
Does it worth to isolate MochiReq here and now while we still have a lot of places where we use it directly? I just quite don't like such kind of generic functions and it seems that this doesn't gives any positive gain now, but one more function in call chain (and traceback).
Member
There was a problem hiding this comment.
Ok, after thinking about the ways how to make the same changes without it, I ended with callbacks. Now sure which one is better here. So ok.
Member
|
+1, |
| ++ ExtraHeaders, | ||
| ResponseHeaders1 = chttpd_cors:headers(Req, ResponseHeaders), | ||
| {ok, MochiReq:serve_file(RelativePath, DocumentRoot, ResponseHeaders1)}. | ||
| serve_file(Req0, RelativePath0, DocumentRoot0, ExtraHeaders) -> |
Member
There was a problem hiding this comment.
Why is every line in this function double-spaced?
Contributor
|
+1 |
1 similar comment
Member
|
+1 |
Following functions were introduced: - add_headers/2 - basic_headers/2 - basic_headers_no_cors/2 COUCHDB-2966
COUCHDB-2966
COUCHDB-2966
It is much easier to write epi plugins if the object it receives is not encoded yet. So we pass unencoded JSON object to chttpd_plugin:before_response COUCHDB-2966
41fdff3 to
3be6796
Compare
asfgit
pushed a commit
that referenced
this pull request
Mar 15, 2016
This closes #150 Signed-off-by: ILYA Khlopotov <iilyak@ca.ibm.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implement
before_responseandbefore_serve_fileEPI hooks.These hooks are useful in following cases:
This is a replacement PR for #133