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

Commit 1341fb3

Browse files
committed
Add ability to specify custom valid status code when storing script
1 parent fdcd80a commit 1341fb3

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/wpxf/wordpress/stored_xss.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def store_script
2525
end
2626

2727
# Call #store_script and validate the response.
28-
# @return [Boolea] return true if the script was successfully stored.
28+
# @return [Boolean] return true if the script was successfully stored.
2929
def store_script_and_validate
3030
res = store_script
3131

@@ -34,12 +34,17 @@ def store_script_and_validate
3434
return false
3535
end
3636

37-
return true if res.code == 200
37+
return true if res.code == expected_status_code_after_store
3838

3939
emit_error "Server responded with code #{res.code}"
4040
false
4141
end
4242

43+
# @return [Number] The status code that is expected after storing the script.
44+
def expected_status_code_after_store
45+
200
46+
end
47+
4348
# Run the module.
4449
# @return [Boolean] true if successful.
4550
def run

0 commit comments

Comments
 (0)