mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2025-06-21 09:05:17 +00:00
Add links support
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
import { Response, Request } from "express";
|
||||
import { APIHelper } from "../helpers/APIHelper";
|
||||
import { APIClient } from "./APIClient";
|
||||
import { checkMail, removeHTMLNodes } from "../utils/StringUtils";
|
||||
import { checkMail, removeHTMLNodes, checkURL } from "../utils/StringUtils";
|
||||
import { AccountHelper } from "../helpers/AccountHelper";
|
||||
import { UploadedFile } from "express-fileupload";
|
||||
import { prepareFileCreation, generateNewUserDataFileName, pathUserData } from "../utils/UserDataUtils";
|
||||
@ -337,6 +337,21 @@ export class RequestHandler {
|
||||
return dir;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an URL included in a POST request
|
||||
*
|
||||
* @param name The name of the POST field containing
|
||||
* the URL
|
||||
*/
|
||||
public postURL(name: string) : string {
|
||||
const url = this.postString(name);
|
||||
|
||||
if(!checkURL(url))
|
||||
this.error(401, "Specified URL in '"+name+"' seems to be invalid!");
|
||||
|
||||
return url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get information about an uploaded file
|
||||
*
|
||||
|
Reference in New Issue
Block a user