Browse Source

Added wsgi script

sqozz 3 years ago
parent
commit
ae96b0c268
2 changed files with 5 additions and 1 deletions
  1. 1
    1
      schort.py
  2. 4
    0
      schort.wsgi

+ 1
- 1
schort.py View File

@@ -28,7 +28,7 @@ def short(shortLink=""):
28 28
 
29 29
 def insertIdUnique(idToCheck, longUrl):
30 30
 	hashUrl = hashlib.sha256(longUrl.encode()).digest()
31
-	base64Url = base64.b64encode(hashUrl).decode()
31
+	base64Url = base64.urlsafe_b64encode(hashUrl).decode()
32 32
 	if len(idToCheck) == 0:
33 33
 		idToCheck = base64Url[:4]
34 34
 

+ 4
- 0
schort.wsgi View File

@@ -0,0 +1,4 @@
1
+#!/usr/bin/env python3
2
+# -*- coding: utf-8 -*-
3
+import schort
4
+application = schort.app.wsgi_app

Loading…
Cancel
Save