New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HttpServer: Support relative plugin paths #10975
HttpServer: Support relative plugin paths #10975
Conversation
Why make things absolute? I really really dislike java code that makes paths absolute when its unnecessary. Seems its only necessary for that the little webserver paths. |
My idea was to unify the code instead of having this one exception with the plugins. |
I don't think we should add code to the codebase and justify the additional code with "well nothing can go wrong by adding it". Either it has a purpose or we don't add it. If we want to do some processing up-front here, i cannot imagine a situation where i'd want to just do absolute+normalize, because its no correct "solution" to anything On the other hand if the proposal was:
Then i could see the advantages: we go full-throttle to the canonical file name for each path which can have a number of advantages and simplifications. |
afaef6e
to
2c22333
Compare
path
configurations are absolute
I actually rethought the whole implementation, and changed only the necessary part in Thx for the helping comment! |
2c22333
to
c44de97
Compare
+1 looks great. |
1090520
to
b883a82
Compare
just fyi, why this is not merged yet. Tests failed on windows, added a fix, but want to make sure this passes on windows before pushing |
28330e9
to
71e3965
Compare
@spinscale I looked at the Windows issue and what I saw was that the code was trying to get a path with the first being relative
|
6d706dc
to
a5eaa49
Compare
|
||
import org.apache.http.impl.client.CloseableHttpClient; | ||
import org.apache.http.impl.client.HttpClients; | ||
import org.apache.lucene.util.Constants; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: unused import now that WINDOWS is a static import below
a5eaa49
to
49ea17e
Compare
@jaymode incorporated review comments, thx for checking |
tested again and all good on Windows. LGTM |
When specifying relative paths on startup, handling plugin paths failed due to recently added security fix. This fix ensures normalization of the plugin path as well. In addition a new matcher has been added to easily check for a status code of an HTTP response likes this assertThat(response, hasStatus(OK)); Closes elastic#10958
49ea17e
to
f05808d
Compare
When specifying relative paths on startup, handling plugin
paths failed due to recently added security fix.
The
HttpServer
now handles this correctlyIn addition a new matcher has been added to easily check for a
status code of an HTTP response likes this
assertThat(response, hasStatus(OK));
Closes #10958