Handling Advanced Device model creation across different browsers (#269)
This commit is contained in:
Родитель
d1a986f1dd
Коммит
ab4fef17d4
|
@ -176,6 +176,9 @@ namespace WebService.Test.v1.Controllers
|
|||
{
|
||||
// Arrange
|
||||
var fileMock = new Mock<IFormFile>();
|
||||
const string FILE_NAME = "test.docx";
|
||||
|
||||
fileMock.Setup(x => x.FileName).Returns(FILE_NAME);
|
||||
|
||||
// Act & Assert
|
||||
Assert.Throws<BadRequestException>(() => this.target.Validate(fileMock.Object));
|
||||
|
|
|
@ -58,7 +58,7 @@ namespace Microsoft.Azure.IoTSolutions.DeviceSimulation.WebService.v1.Controller
|
|||
throw new BadRequestException("No data provided.");
|
||||
}
|
||||
|
||||
if (file.ContentType != TEXT_JAVASCRIPT)
|
||||
if (file.ContentType != TEXT_JAVASCRIPT && !file.FileName.EndsWith(".js"))
|
||||
{
|
||||
this.log.Warn("Wrong content type provided", () => new { file.ContentType });
|
||||
throw new BadRequestException("Wrong content type provided.");
|
||||
|
@ -93,7 +93,7 @@ namespace Microsoft.Azure.IoTSolutions.DeviceSimulation.WebService.v1.Controller
|
|||
throw new BadRequestException("No data provided.");
|
||||
}
|
||||
|
||||
if (file.ContentType != TEXT_JAVASCRIPT)
|
||||
if (file.ContentType != TEXT_JAVASCRIPT && !file.FileName.EndsWith(".js"))
|
||||
{
|
||||
this.log.Warn("Wrong content type provided", () => new { file.ContentType });
|
||||
throw new BadRequestException("Wrong content type provided.");
|
||||
|
|
Загрузка…
Ссылка в новой задаче