Skip to content

Commit

Permalink
Merge branch 'verify-none-for-httpc-request'
Browse files Browse the repository at this point in the history
* verify-none-for-httpc-request:
  pass verify_none to httpc:request
  • Loading branch information
andreineculau committed Jul 26, 2024
2 parents eafa983 + 6d80c93 commit 1f5ab6e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/jesse_database.erl
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,8 @@ add_file_uri(Key0) ->
%% @private
add_http_uri(Key0) ->
Key = jesse_state:canonical_path(Key0, Key0),
{ok, Response} = httpc:request(get, {Key, []}, [], [{body_format, binary}]),
HttpOptions = [{ssl, [{verify, verify_none}]}],
{ok, Response} = httpc:request(get, {Key, []}, HttpOptions, [{body_format, binary}]),
{{_Line, 200, _}, Headers, SchemaBin} = Response,
Schema = jsx:decode(SchemaBin, [{return_maps, false}]),
SchemaInfos = [{Key, get_http_mtime(Headers), Schema}],
Expand Down
3 changes: 2 additions & 1 deletion test/jesse_tests_util.erl
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ get_path(Key, Schema) ->
jesse_json_path:path(Key, Schema).

load_schema(URI) ->
{ok, Response} = httpc:request(get, {URI, []}, [], [{body_format, binary}]),
HttpOptions = [{ssl, [{verify, verify_none}]}],
{ok, Response} = httpc:request(get, {URI, []}, HttpOptions, [{body_format, binary}]),
{{_Line, 200, _}, _Headers, Body} = Response,
jsx:decode(Body, [{return_maps, false}]).

0 comments on commit 1f5ab6e

Please sign in to comment.