The templates use net/http.Request.Host to format the URLs on the index page. If you run this behind a reverse proxy (and don't forward or set the Host header), this will print the listen address.
The templates use `net/http.Request.Host` to format the URLs on the index page. If you run this behind a reverse proxy (and don't forward or set the `Host` header), this will print the listen address.
In my local install, I've also patched the index template to use https anchors.
diff --git a/assets/templates/html/index.html.tmpl b/assets/templates/html/index.html.tmpl
index 7eae1d1..e763a98 100644
--- a/assets/templates/html/index.html.tmpl
+++ b/assets/templates/html/index.html.tmpl
@@ -9,12 +9,12 @@ the command line.
## USAGE
# Upload a file
- curl -F'file=@yourfile.png' <a href="{{.Request.Host}}">{{.Request.Host}}</a>
+ curl -F'file=@yourfile.png' <a href="//{{.Request.Host}}">https://{{.Request.Host}}</a>
# Shorten a URL
- curl -F'shorten=http://example.com/some/long/url' <a href="{{.Request.Host}}">{{.Request.Host}}</a>
+ curl -F'shorten=http://example.com/some/long/url' <a href="//{{.Request.Host}}">https://{{.Request.Host}}</a>
# Shorten a URL with a token to delete it later
- curl -F'shorten=http://example.com/some/long/url' -F'deleteToken=' <a href="{{.Request.Host}}">{{.Request.Host}}</a>
+ curl -F'shorten=http://example.com/some/long/url' -F'deleteToken=' <a href="//{{.Request.Host}}">https://{{.Request.Host}}</a>
</pre>
-{{end}}
\ No newline at end of file
+{{end}}
diff --git a/assets/templates/txt/index.txt.tmpl b/assets/templates/txt/index.txt.tmpl
index ac238f4..7b331b0 100644
--- a/assets/templates/txt/index.txt.tmpl
+++ b/assets/templates/txt/index.txt.tmpl
@@ -7,10 +7,10 @@ the command line.
## USAGE
# Upload a file
- curl -F'file=@yourfile.png' {{.Request.Host}}
+ curl -F'file=@yourfile.png' https://{{.Request.Host}}
# Shorten a URL
- curl -F'shorten=http://example.com/some/long/url' {{.Request.Host}}
+ curl -F'shorten=http://example.com/some/long/url' https://{{.Request.Host}}
# Shorten a URL with a token to delete it later
- curl -F'shorten=http://example.com/some/long/url' -F'deleteToken=' {{.Request.Host}}
\ No newline at end of file
+ curl -F'shorten=http://example.com/some/long/url' -F'deleteToken=' https://{{.Request.Host}}
In my local install, I've also patched the index template to use https anchors.
```
diff --git a/assets/templates/html/index.html.tmpl b/assets/templates/html/index.html.tmpl
index 7eae1d1..e763a98 100644
--- a/assets/templates/html/index.html.tmpl
+++ b/assets/templates/html/index.html.tmpl
@@ -9,12 +9,12 @@ the command line.
## USAGE
# Upload a file
- curl -F'file=@yourfile.png' <a href="{{.Request.Host}}">{{.Request.Host}}</a>
+ curl -F'file=@yourfile.png' <a href="//{{.Request.Host}}">https://{{.Request.Host}}</a>
# Shorten a URL
- curl -F'shorten=http://example.com/some/long/url' <a href="{{.Request.Host}}">{{.Request.Host}}</a>
+ curl -F'shorten=http://example.com/some/long/url' <a href="//{{.Request.Host}}">https://{{.Request.Host}}</a>
# Shorten a URL with a token to delete it later
- curl -F'shorten=http://example.com/some/long/url' -F'deleteToken=' <a href="{{.Request.Host}}">{{.Request.Host}}</a>
+ curl -F'shorten=http://example.com/some/long/url' -F'deleteToken=' <a href="//{{.Request.Host}}">https://{{.Request.Host}}</a>
</pre>
-{{end}}
\ No newline at end of file
+{{end}}
diff --git a/assets/templates/txt/index.txt.tmpl b/assets/templates/txt/index.txt.tmpl
index ac238f4..7b331b0 100644
--- a/assets/templates/txt/index.txt.tmpl
+++ b/assets/templates/txt/index.txt.tmpl
@@ -7,10 +7,10 @@ the command line.
## USAGE
# Upload a file
- curl -F'file=@yourfile.png' {{.Request.Host}}
+ curl -F'file=@yourfile.png' https://{{.Request.Host}}
# Shorten a URL
- curl -F'shorten=http://example.com/some/long/url' {{.Request.Host}}
+ curl -F'shorten=http://example.com/some/long/url' https://{{.Request.Host}}
# Shorten a URL with a token to delete it later
- curl -F'shorten=http://example.com/some/long/url' -F'deleteToken=' {{.Request.Host}}
\ No newline at end of file
+ curl -F'shorten=http://example.com/some/long/url' -F'deleteToken=' https://{{.Request.Host}}
```
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
The templates use
net/http.Request.Hostto format the URLs on the index page. If you run this behind a reverse proxy (and don't forward or set theHostheader), this will print the listen address.In my local install, I've also patched the index template to use https anchors.