Page MenuHomePhorge

D293.1773966217.diff
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

D293.1773966217.diff

diff --git a/src/client/actions/auth.cpp b/src/client/actions/auth.cpp
--- a/src/client/actions/auth.cpp
+++ b/src/client/actions/auth.cpp
@@ -158,17 +158,19 @@
ClientResult processResponse(ClientModel m, GetVersionsResponse r)
{
+ if (!r.success()) {
+ return {
+ std::move(m),
+ failWithResponse(r)
+ };
+ }
m.versions = r.versions();
return {
std::move(m),
[r](auto &&ctx) {
- if (r.success()) {
- return EffectStatus(r.success(), json{
- {"versions", r.versions()},
- });
- } else {
- return failWithResponse(r)(std::forward<decltype(ctx)>(ctx));
- }
+ return EffectStatus(r.success(), json{
+ {"versions", r.versions()},
+ });
}
};
}
diff --git a/src/tests/client/get-versions-test.cpp b/src/tests/client/get-versions-test.cpp
--- a/src/tests/client/get-versions-test.cpp
+++ b/src/tests/client/get-versions-test.cpp
@@ -58,5 +58,15 @@
});
}
+ WHEN("Failed response without json body")
+ {
+ auto fileResponse = makeResponse("GetVersions",
+ withResponseStatusCode(403) | withResponseBytesBody(""));
+ store.dispatch(ProcessResponseAction{fileResponse})
+ .then([client](auto stat) {
+ REQUIRE(!stat.success());
+ });
+ }
+
io.run();
}

File Metadata

Mime Type
text/plain
Expires
Thu, Mar 19, 5:23 PM (7 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1210981
Default Alt Text
D293.1773966217.diff (1 KB)

Event Timeline