Skip to content
This repository has been archived by the owner on Mar 22, 2023. It is now read-only.

Support multiple hostnames #154

Merged
merged 3 commits into from Oct 10, 2017
Merged

Conversation

pschorf
Copy link
Contributor

@pschorf pschorf commented Oct 10, 2017

No description provided.

hostnames (if (sequential? hostname)
(clojure.set/union (set hostname)
#{waiter-router-hostname waiter-router-ip})
(set [hostname waiter-router-hostname waiter-router-ip]))]
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: Can we use the set literal here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

(waiter-request?-factory (set [hostname waiter-router-hostname waiter-router-ip]))))
waiter-router-ip (.getHostAddress local-router)
hostnames (if (sequential? hostname)
(clojure.set/union (set hostname)
Copy link
Contributor

Choose a reason for hiding this comment

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

clojure.set is already imported, we can just do set/union

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

waiter-router-ip (.getHostAddress local-router)]
(waiter-request?-factory (set [hostname waiter-router-hostname waiter-router-ip]))))
waiter-router-ip (.getHostAddress local-router)
hostnames (if (sequential? hostname)
Copy link
Contributor

Choose a reason for hiding this comment

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

+1 on use of sequential?

@@ -1099,3 +1099,14 @@

(testing "require-authentication"
(is (= {:source :spnego-handler} (request-handler {:headers {}})))))))

(deftest test-waiter-request?-fn
Copy link
Contributor

Choose a reason for hiding this comment

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

The test should also include negative scenarios, e.g. (is (not (waiter-request?-fn {:headers {"host" "waiter-host-1"}}))) in the first testing block.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

(let [config {:settings {:hostname "waiter-host"}}
waiter-request?-fn ((:waiter-request?-fn routines) config)]
(is (waiter-request?-fn {:headers {"host" "waiter-host"}}))))
(testing "list hostname config"
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: separate these two testing blocks with a whitepsace.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@shamsimam shamsimam merged commit 3b91139 into twosigma:master Oct 10, 2017
@sradack
Copy link
Contributor

sradack commented Oct 11, 2017

Why did we merge before a passing build?

@@ -700,8 +700,12 @@
:waiter-request?-fn (pc/fnk [[:settings hostname]]
Copy link
Contributor

Choose a reason for hiding this comment

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

This isn't the only place hostname is used.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants