Skip to content
This repository was archived by the owner on Oct 22, 2020. It is now read-only.

Commit 2eb6458

Browse files
committed
Add #expected_upload_response_code
1 parent 8a35bf8 commit 2eb6458

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/wpxf/wordpress/shell_upload.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ def before_upload
5555
true
5656
end
5757

58+
# @return [Integer] the response code to expect from a successful upload operation.
59+
def expected_upload_response_code
60+
200
61+
end
62+
5863
# Run the module.
5964
# @return [Boolean] true if successful.
6065
def run
@@ -101,7 +106,7 @@ def upload_payload(builder)
101106
return false
102107
end
103108

104-
if @upload_result.code != 200
109+
if @upload_result.code != expected_upload_response_code
105110
emit_info "Response code: #{@upload_result.code}", true
106111
emit_info "Response body: #{@upload_result.body}", true
107112
emit_error 'Failed to upload payload'

0 commit comments

Comments
 (0)