mirror of
https://gitee.com/dcren/initializr.git
synced 2025-08-25 10:08:15 +08:00
Add User-Agent rule for Nx client
Closes gh-1143
This commit is contained in:
parent
4c78853399
commit
aa2570468a
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -108,6 +108,11 @@ public class Agent {
|
||||
*/
|
||||
JENKINSX("jenkinsx", "jx"),
|
||||
|
||||
/**
|
||||
* NX.
|
||||
*/
|
||||
NX("nx", "@nxrocks_nx-spring-boot"),
|
||||
|
||||
/**
|
||||
* A generic browser.
|
||||
*/
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -97,6 +97,13 @@ class AgentTests {
|
||||
assertThat(agent.getVersion()).isEqualTo("1.1.71");
|
||||
}
|
||||
|
||||
@Test
|
||||
void checkNx() {
|
||||
Agent agent = Agent.fromUserAgent("@nxrocks_nx-spring-boot/1.0.0");
|
||||
assertThat(agent.getId()).isEqualTo(Agent.AgentId.NX);
|
||||
assertThat(agent.getVersion()).isEqualTo("1.0.0");
|
||||
}
|
||||
|
||||
@Test
|
||||
void checkGenericBrowser() {
|
||||
Agent agent = Agent.fromUserAgent("Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5 Build/MMB29K) ");
|
||||
|
Loading…
Reference in New Issue
Block a user