@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		if (!httpAuth.isAllowed(req, resp)) {
			return;
		}

		// post du formulaire d'ajout d'application à monitorer
		I18N.bindLocale(req.getLocale());
		try {
			addCollectorApplication(req, resp);
		} catch (final Exception e) {
			LOGGER.warn(e.toString(), e);
			final String userAgent = req.getHeader("User-Agent");
			if (userAgent != null && userAgent.startsWith("Java")) {
				resp.sendError(HttpServletResponse.SC_PRECONDITION_FAILED, e.toString());
			} else {
				final CollectorController collectorController = new CollectorController(
						collectorServer);
				final String application = collectorController.getApplication(req, resp);
				collectorController.writeMessage(req, resp, application, e.toString());
			}
		} finally {
			I18N.unbindLocale();
		}
	}
@Test
	public void testDoPost() throws ServletException, IOException {
		final List<String> nullUrl = Collections.singletonList(null);
		doPost(null, nullUrl, false);
		doPost(null, nullUrl, true);
		doPost(TEST, nullUrl, true);
		doPost(TEST, List.of("http://localhost:8090/test", "http://localhost:8090/test"), true);
		doPost(TEST, List.of("https://localhost:8090/test", "http://localhost:8090/test"), true);
		doPost(TEST, List.of("ftp://localhost:8090/test"), true);
		doPost(TEST, List.of("http://une url,pas une url"), true);
	}