You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by iilyak <gi...@git.apache.org> on 2016/01/20 17:44:16 UTC

[GitHub] couchdb-chttpd pull request: Add chttpd_plugin:before_response/4 h...

GitHub user iilyak opened a pull request:

    https://github.com/apache/couchdb-chttpd/pull/99

    Add chttpd_plugin:before_response/4 hook

    This hook is useful in following casses:
    
      - to inject vendor specific headers
      - to inject vendor keys into json objects returned to client
      - to override return code
    
    This PR depends on:
    
     - https://github.com/apache/couchdb-couch/pull/133

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/cloudant/couchdb-chttpd before_response_hook

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/couchdb-chttpd/pull/99.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #99
    
----
commit e769e8ae0f3eb75bfedfd6d429e9b01daa2ca9b4
Author: ILYA Khlopotov <ii...@ca.ibm.com>
Date:   2016-01-20T14:03:12Z

    Add chttpd_plugin:before_response/4 hook
    
    This hook is useful in following casses:
    
      - to inject vendor specific headers
      - to inject vendor keys into json objects returned to client
      - to override return code

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-chttpd pull request: Add chttpd_plugin:before_response/4 h...

Posted by iilyak <gi...@git.apache.org>.
Github user iilyak closed the pull request at:

    https://github.com/apache/couchdb-chttpd/pull/99


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-chttpd pull request: Add chttpd_plugin:before_response/4 h...

Posted by iilyak <gi...@git.apache.org>.
Github user iilyak commented on the pull request:

    https://github.com/apache/couchdb-chttpd/pull/99#issuecomment-175027967
  
    @jaydoane: Fixed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-chttpd pull request: Add chttpd_plugin:before_response/4 h...

Posted by iilyak <gi...@git.apache.org>.
Github user iilyak commented on the pull request:

    https://github.com/apache/couchdb-chttpd/pull/99#issuecomment-196402779
  
    Closing in favor of https://github.com/apache/couchdb-chttpd/pull/106


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-chttpd pull request: Add chttpd_plugin:before_response/4 h...

Posted by jaydoane <gi...@git.apache.org>.
Github user jaydoane commented on a diff in the pull request:

    https://github.com/apache/couchdb-chttpd/pull/99#discussion_r50775363
  
    --- Diff: src/chttpd.erl ---
    @@ -689,10 +689,14 @@ send_chunk(Resp, Data) ->
         Resp:write_chunk(Data),
         {ok, Resp}.
     
    -send_response(#httpd{mochi_req=MochiReq}=Req, Code, Headers0, Body) ->
    +send_response(#httpd{}=Req0, Code0, Headers0, Body0) ->
    +    Headers1 = Headers0 ++ server_header() ++
    +	[timing(), reqid() | couch_httpd_auth:cookie_auth_header(Req0, Headers0)],
    +
    +    {ok, {#httpd{mochi_req=MochiReq}=Req, Code, Headers, Body}} =
    --- End diff --
    
    I get a compiler warning for unused Req on this line


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---