mirror of
https://git.teknik.io/Teknikode/Teknik.git
synced 2023-08-02 14:16:22 +02:00
Added doNotTrack option to the API.
This commit is contained in:
parent
668f6acae2
commit
984eab6501
@ -27,10 +27,11 @@ namespace Teknik.Areas.API.Controllers
|
||||
|
||||
[HttpPost]
|
||||
[AllowAnonymous]
|
||||
public ActionResult Upload(HttpPostedFileWrapper file, string contentType = null, bool encrypt = false, bool saveKey = false, string key = null, int keySize = 0, string iv = null, int blockSize = 0, bool genDeletionKey = false)
|
||||
public ActionResult Upload(HttpPostedFileWrapper file, string contentType = null, bool encrypt = false, bool saveKey = false, string key = null, int keySize = 0, string iv = null, int blockSize = 0, bool genDeletionKey = false, bool doNotTrack = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!doNotTrack)
|
||||
Tracking.TrackPageView(Request, "Upload");
|
||||
if (file != null)
|
||||
{
|
||||
@ -127,10 +128,11 @@ namespace Teknik.Areas.API.Controllers
|
||||
|
||||
[HttpPost]
|
||||
[AllowAnonymous]
|
||||
public ActionResult Paste(string code, string title = "", string syntax = "auto", string expireUnit = "never", int expireLength = 1, string password = "", bool hide = false)
|
||||
public ActionResult Paste(string code, string title = "", string syntax = "auto", string expireUnit = "never", int expireLength = 1, string password = "", bool hide = false, bool doNotTrack = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!doNotTrack)
|
||||
Tracking.TrackPageView(Request, "Paste");
|
||||
Paste.Models.Paste paste = PasteHelper.CreatePaste(code, title, syntax, expireUnit, expireLength, password, hide);
|
||||
|
||||
@ -156,10 +158,11 @@ namespace Teknik.Areas.API.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
public ActionResult Shorten(string url)
|
||||
public ActionResult Shorten(string url, bool doNotTrack = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!doNotTrack)
|
||||
Tracking.TrackPageView(Request, "Shorten");
|
||||
if (url.IsValidUrl())
|
||||
{
|
||||
|
@ -129,6 +129,20 @@
|
||||
If the paste should be visible in the most recent pastes list.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>doNotTrack</code>
|
||||
</td>
|
||||
<td>
|
||||
<code>bool</code>
|
||||
</td>
|
||||
<td>
|
||||
<var>false</var>
|
||||
</td>
|
||||
<td>
|
||||
If you do not want the api request to be tracked as defined in the privacy policy.
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h4>Response</h4>
|
||||
|
@ -35,6 +35,20 @@
|
||||
The url you want to shorten. This url must be an absolute url.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>doNotTrack</code>
|
||||
</td>
|
||||
<td>
|
||||
<code>bool</code>
|
||||
</td>
|
||||
<td>
|
||||
<var>false</var>
|
||||
</td>
|
||||
<td>
|
||||
If you do not want the api request to be tracked as defined in the privacy policy.
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h4>Response</h4>
|
||||
|
@ -147,6 +147,20 @@
|
||||
Generates a deletion key.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>doNotTrack</code>
|
||||
</td>
|
||||
<td>
|
||||
<code>bool</code>
|
||||
</td>
|
||||
<td>
|
||||
<var>false</var>
|
||||
</td>
|
||||
<td>
|
||||
If you do not want the api request to be tracked as defined in the privacy policy.
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h4>Response</h4>
|
||||
|
Loading…
Reference in New Issue
Block a user