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

Handle LazySeq key value in RingResponseAdapter header add #29

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ your PR.
On a *_nix_ system, run the `dev-branch.sh` script to create a new development
branch. For example:
```shell
./dev-branch 0.3.1
./dev-branch.sh 0.3.1
```
The script will create a branch `0.3.1` and update the project to version
`0.3.1-SNAPSHOT`. For those who work on a Windows system, you'll have to do
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Including the library in `pom.xml`
<dependency>
<groupId>com.appsflyer</groupId>
<artifactId>donkey</artifactId>
<version>0.5.2</version>
<version>0.5.3-SNAPSHOT</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<description>Clojure Server and Client</description>
<groupId>com.appsflyer</groupId>
<artifactId>donkey</artifactId>
<version>0.5.2</version>
<version>0.5.3-SNAPSHOT</version>
<packaging>clojure</packaging>
<url>https://github.com/AppsFlyer/donkey</url>
<inceptionYear>2020</inceptionYear>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import clojure.lang.IMapEntry;
import clojure.lang.IPersistentMap;
import clojure.lang.LazySeq;
import io.vertx.core.http.HttpServerResponse;
import io.vertx.ext.web.RoutingContext;
import org.slf4j.Logger;
Expand Down Expand Up @@ -60,7 +61,11 @@ private void addHeaders(HttpServerResponse serverResponse, IPersistentMap ringRe
if (headers != null) {
for (var obj : headers) {
var pair = (IMapEntry) obj;
serverResponse.putHeader((CharSequence) pair.getKey(), (CharSequence) pair.getValue());
if (pair.getValue() instanceof clojure.lang.LazySeq)
serverResponse.putHeader((CharSequence) pair.getKey(),
(CharSequence) ((clojure.lang.LazySeq) pair.getValue()).first());
else
serverResponse.putHeader((CharSequence) pair.getKey(), (CharSequence) pair.getValue());
}
}
}
Expand Down