REVIEW: [NEXUS-6786] Allow exclusion of specific User Agents from browser detection (NX2)

https://issues.sonatype.org/browse/NEXUS-6786

This allows one to specify one or more specific user agent strings in $NEXUS_HOME/config/nexus.properties (using the property nexus.browserdetector.excludedUserAgents, which is \n delimited) which will be skipped and therefore presumed to be NON-browser user agents for the purpose of browser detection. This will result in Nexus providing the WWW-Authenticate response header with all 401 responses from such UAs.

Here's an example to specify multiple UAs in nexus.properties: (the trailing \ is not required, but allows you to specify one per line in the file, for readability)

nexus.browserdetector.excludedUserAgents=UserAgentString1\n\
    UserAgentString2\n\
    etc..

To test this with your browser, note your browser's User-Agent string and set it as the value of this property, restart nexus, make sure your browser is logged out, and issue an HTTP GET for http://localhost:8081/nexus/service/local  You should get a 401 with a WWW-Authenticate header, causing the browser to launch a basic auth dialog.