Skip to content
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

[FIX JENKINS-40710, JENKINS-41513] Add null check, use correct header for map key #140

Merged
merged 1 commit into from
Jan 31, 2017

Conversation

cgag
Copy link
Contributor

@cgag cgag commented Jan 10, 2017

I just tested this fix (I filed the bug) and ran into an NPE (even when there are headers, it appears the keyset contains null), and then realized it was still returning null even after matching because it was indexing into the map with the incorrectly cased header.

@oleg-nenashev oleg-nenashev changed the title [FIX JENKINS-40710] Add null check, use correct header for map key [FIX JENKINS-40710, JENKINS-41513] Add null check, use correct header for map key Jan 31, 2017
@oleg-nenashev
Copy link
Member

CC @daniel-beck

@oleg-nenashev oleg-nenashev merged commit 813489e into jenkinsci:master Jan 31, 2017
@oleg-nenashev
Copy link
Member

oleg-nenashev commented Jan 31, 2017

@cgag Integrated the fix, thanks!

oleg-nenashev added a commit to oleg-nenashev/jenkins that referenced this pull request Feb 17, 2017
https://github.com/jenkinsci/remoting/edit/master/CHANGELOG.md

Fixed issues:

* [JENKINS-40710](https://issues.jenkins-ci.org/browse/JENKINS-40710) - Match headers case-insensitively in `JnlpAgentEndpointResolver` in order to be compliant with HTTP2 lower-case headers. ([PR jenkinsci#139](jenkinsci/remoting#139), [PR jenkinsci#140](jenkinsci/remoting#140))
* [JENKINS-41513](https://issues.jenkins-ci.org/browse/JENKINS-41513) - Prevent `NullPointerException` in `JnlpAgentEndpointResolver` when receiving a header with `null` name. ([PR jenkinsci#140](jenkinsci/remoting#140))
* [JENKINS-41852](https://issues.jenkins-ci.org/browse/JENKINS-41852) - Fix exported object pinning logic to prevent release due to the integer overflow. ([PR jenkinsci#148](jenkinsci/remoting#148))

Improvements:

* [JENKINS-41730](https://issues.jenkins-ci.org/browse/JENKINS-41730) - Add the new `org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver.ignoreJenkinsAgentProtocolsHeader` property, which allows specifying a custom list of supported protocols instead of the one returned by the Jenkins master. ([PR jenkinsci#146](jenkinsci/remoting#146))
* Print the Filesystem Jar Cache directory location in the error message when this cache directory is not writable. ([PR jenkinsci#143](jenkinsci/remoting#143))
* Replace `MimicException` with the older `ProxyException` when serializing non-serializable exceptions thrown by the remote code. ([PR jenkinsci#141](jenkinsci/remoting#141))
* Use OID of the `ClassLoaderProxy` in error message when the proxy cannot be located in the export table. ([PR jenkinsci#147](jenkinsci/remoting#147))
@olivergondza
Copy link
Member

FTR, it seems that HttpURLConnection stored the first line (like HTTP/1.1 301 Moved Permanently) as the null key.

olivergondza pushed a commit to jenkinsci/jenkins that referenced this pull request Mar 13, 2017
https://github.com/jenkinsci/remoting/edit/master/CHANGELOG.md

Fixed issues:

* [JENKINS-40710](https://issues.jenkins-ci.org/browse/JENKINS-40710) - Match headers case-insensitively in `JnlpAgentEndpointResolver` in order to be compliant with HTTP2 lower-case headers. ([PR #139](jenkinsci/remoting#139), [PR #140](jenkinsci/remoting#140))
* [JENKINS-41513](https://issues.jenkins-ci.org/browse/JENKINS-41513) - Prevent `NullPointerException` in `JnlpAgentEndpointResolver` when receiving a header with `null` name. ([PR #140](jenkinsci/remoting#140))
* [JENKINS-41852](https://issues.jenkins-ci.org/browse/JENKINS-41852) - Fix exported object pinning logic to prevent release due to the integer overflow. ([PR #148](jenkinsci/remoting#148))

Improvements:

* [JENKINS-41730](https://issues.jenkins-ci.org/browse/JENKINS-41730) - Add the new `org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver.ignoreJenkinsAgentProtocolsHeader` property, which allows specifying a custom list of supported protocols instead of the one returned by the Jenkins master. ([PR #146](jenkinsci/remoting#146))
* Print the Filesystem Jar Cache directory location in the error message when this cache directory is not writable. ([PR #143](jenkinsci/remoting#143))
* Replace `MimicException` with the older `ProxyException` when serializing non-serializable exceptions thrown by the remote code. ([PR #141](jenkinsci/remoting#141))
* Use OID of the `ClassLoaderProxy` in error message when the proxy cannot be located in the export table. ([PR #147](jenkinsci/remoting#147))

(cherry picked from commit 815da8a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants