From 12274a2adc7aac55188b7eb84100b9df318553d8 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Sun, 30 Aug 2015 00:12:53 +0200 Subject: [PATCH] mod_http_upload: Fix HTTP response matching Fix the case where a service_url is specified and the service returns a non-2xx status code. --- mod_http_upload/src/mod_http_upload.erl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mod_http_upload/src/mod_http_upload.erl b/mod_http_upload/src/mod_http_upload.erl index 3ee0e23..c109a58 100644 --- a/mod_http_upload/src/mod_http_upload.erl +++ b/mod_http_upload/src/mod_http_upload.erl @@ -519,16 +519,16 @@ create_slot(#state{service_url = ServiceURL}, User, File, Size, ContentType, [User, ServiceURL, Lines]), {error, ?ERR_SERVICE_UNAVAILABLE} end; - {error, {402, _Body}} -> + {ok, {402, _Body}} -> ?INFO_MSG("Got status code 402 for ~s from <~s>", [User, ServiceURL]), {error, ?ERR_RESOURCE_CONSTRAINT}; - {error, {403, _Body}} -> + {ok, {403, _Body}} -> ?INFO_MSG("Got status code 403 for ~s from <~s>", [User, ServiceURL]), {error, ?ERR_NOT_ALLOWED}; - {error, {413, _Body}} -> + {ok, {413, _Body}} -> ?INFO_MSG("Got status code 413 for ~s from <~s>", [User, ServiceURL]), {error, ?ERR_NOT_ACCEPTABLE}; - {error, {Code, _Body}} -> + {ok, {Code, _Body}} -> ?ERROR_MSG("Got unexpected status code ~s from <~s>: ~B", [User, ServiceURL, Code]), {error, ?ERR_SERVICE_UNAVAILABLE};