Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ index.set_settings searchableAttributes: %w(
)
```

**Note:** If you are behind a proxy, set `HTTP_PROXY` environment variable.

## Search

You can now search for contacts using `firstname`, `lastname`, `company`, etc. (even with typos):
Expand Down
2 changes: 1 addition & 1 deletion lib/algolia/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ def delete(uri, type = :write, request_options = {})
def thread_local_hosts(read)
thread_hosts_key = read ? "algolia_search_hosts_#{application_id}" : "algolia_hosts_#{application_id}"
Thread.current[thread_hosts_key] ||= (read ? search_hosts : hosts).each_with_index.map do |host, i|
client = HTTPClient.new
client = HTTPClient.new(ENV["HTTP_PROXY"])
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't be needed because the httpclient library already read this variables:

Any chance you could tell us what happens in this load_environment method in your case @vinc ? Maybe you have a REQUEST_METHOD variable forcing the code to look for cgi_http_proxy ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed yesterday our fork seemed to fix the issue we had on our production server, but we switched back to the original gem after reading your comment and everything is still working.

Therefor the issue we were having seems to have been totally unrelated!

So we can close this PR, and I apologize for your time spent on this :3

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem @vinc thanks for contributing!

client.ssl_config.ssl_version = @ssl_version if @ssl && @ssl_version
client.transparent_gzip_decompression = @gzip
client.ssl_config.add_trust_ca File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'resources', 'ca-bundle.crt'))
Expand Down