This is a utility for finding and replacing http URLs using nohttp. It takes into account whitelisting rules that nohttp uses.
The application is a Spring Boot application. The application requires JDK 8+ to compile and run.
Snapshots are available for download at https://repo.spring.io/libs-snapshot/io/spring/nohttp/nohttp-cli/
Releases are available for download at https://repo.maven.apache.org/maven2/io/spring/nohttp/nohttp-cli/
Once you download, we recommend exporting the jar to a variable named
To use this app first create the jar
The jar will now available at
You can then export the full path to a variable.
The guide assumes that the jar is now available in the variable
If that is not true, you can substitute
$NOHTTP for the absolute path of
It is best to run this in a folder that does not have any files with build output.
If you use git, a great way to ensure that there are no build output is to do a fresh clone.
Alternatively, you can remove all files not added to git using
git clean -dfx.
Keep in mind this may delete things you want (i.e. IDE related files).
The easiest approach is to run the application with no arguments.
This will attempt to find http in all text based files in the current directory while ignoring
The process for checking if it is a text file uses a native invocation of
java -jar $NOHTTP
java -jar $NOHTTP -r
You can get help with additional options using
java -jar $NOHTTP --help ... Usage: nohttp [-fhMrsTV] [-w=<whitelistFile>] [-D=<regex>]... [-F=<regex>]... [<dir>] [<dir>] The directory to scan. Default is current working directory. -D=<regex> Regular expression of directories to exclude scanning. Specify multiple times to provide multiple exclusions. Default is to exclude .git -f If true, prints out the file names. -F=<regex> Regular expression of files to exclude scanning. Specify multiple times to provide multiple exclusions. Default is no file exclusions. -h, --help Show this help message and exit. -M Disables printing each match within their specific files. -r Enables replacing the values that were found. The default is to just find the results. -s Enables checking the http status before determining if replacement should be done. -T Disable searching only text based files. This is determined using native invocation of grep which will not work on all systems, so it can be disabled. -V, --version Print version information and exit. -w=<whitelistFile> The path to file that contains additional whitelist of allowed URLs. The format is a regular expression to whitelist (ignore http URLs) per line.