-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #38 allow referer passing via query parameter
- Loading branch information
Showing
6 changed files
with
65 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// SPDX-FileCopyrightText: NOI Techpark <[email protected]> | ||
// | ||
// SPDX-License-Identifier: AGPL-3.0-or-later | ||
package it.bz.idm.bdp.ninja.utils; | ||
|
||
import javax.servlet.http.HttpServletRequest; | ||
|
||
import org.apache.logging.log4j.util.Strings; | ||
|
||
public class Referer { | ||
public static String getReferer(HttpServletRequest req) { | ||
String referer = req.getParameter("referer"); | ||
if (Strings.isNotBlank(referer)) | ||
return referer; | ||
|
||
referer = req.getParameter("Referer"); | ||
if (Strings.isNotBlank(referer)) | ||
return referer; | ||
|
||
referer = req.getHeader("Referer"); | ||
return referer; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters