Sets the referer HTTP header - only if the provided url is valid. @param url the url for the referer HTTP header
(final URL url)
| 547 | * @param url the url for the referer HTTP header |
| 548 | */ |
| 549 | public void setRefererHeader(final URL url) { |
| 550 | if (url == null || !url.getProtocol().startsWith("http")) { |
| 551 | return; |
| 552 | } |
| 553 | |
| 554 | try { |
| 555 | setAdditionalHeader(HttpHeader.REFERER, UrlUtils.getUrlWithoutRef(url).toExternalForm()); |
| 556 | } |
| 557 | catch (final MalformedURLException ignored) { |
| 558 | // bad luck us the whole url from the pager |
| 559 | } |
| 560 | } |
| 561 | |
| 562 | /** |
| 563 | * Sets the specified name/value pair in the additional HTTP headers. |
no test coverage detected