Upload protected from outside

main
Inga 🏳‍🌈 14 years ago
parent 934a6a821d
commit 1c5140c130
  1. 2
      Builder/IISMainHandler/build.txt
  2. 5
      IISMainHandler/handlers/response/UploadHandler.cs
  3. 3
      IISMainHandler/handlers/response/UploadInfoHandler.cs

@ -19,6 +19,11 @@ namespace FLocal.IISHandler.handlers.response {
}
protected override string getRedirectUrl(WebContext context) {
Uri referer = context.httprequest.UrlReferrer;
if(referer == null || referer.Host != context.httprequest.Url.Host) {
throw new AccessViolationException();
}
return Config.instance.UploaderUrl + "Data/" + this.url.upload.hash + "." + this.url.upload.extension;
}

@ -19,6 +19,9 @@ namespace FLocal.IISHandler.handlers.response {
}
protected override IEnumerable<XElement> getSpecificData(WebContext context) {
if(context.session == null) {
throw new AccessViolationException();
}
return new XElement[] {
this.url.upload.exportToXml(context),
};

Loading…
Cancel
Save