forked from Qortal/qortal
Removed service from POST /render/preview/{service} API as it isn't needed right now
This commit is contained in:
parent
08b79e45cf
commit
29bd8203b5
@ -43,7 +43,7 @@ public class RenderResource {
|
|||||||
@Context ServletContext context;
|
@Context ServletContext context;
|
||||||
|
|
||||||
@POST
|
@POST
|
||||||
@Path("/preview/{service}")
|
@Path("/preview")
|
||||||
@Operation(
|
@Operation(
|
||||||
summary = "Generate preview URL based on a user-supplied path and service",
|
summary = "Generate preview URL based on a user-supplied path and service",
|
||||||
requestBody = @RequestBody(
|
requestBody = @RequestBody(
|
||||||
@ -68,7 +68,7 @@ public class RenderResource {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
@SecurityRequirement(name = "apiKey")
|
@SecurityRequirement(name = "apiKey")
|
||||||
public String preview(@PathParam("service") Service service, String directoryPath) {
|
public String preview(String directoryPath) {
|
||||||
Security.checkApiCallAllowed(request);
|
Security.checkApiCallAllowed(request);
|
||||||
|
|
||||||
// It's too dangerous to allow user-supplied filenames in weaker security contexts
|
// It's too dangerous to allow user-supplied filenames in weaker security contexts
|
||||||
@ -80,7 +80,7 @@ public class RenderResource {
|
|||||||
Method method = Method.PUT;
|
Method method = Method.PUT;
|
||||||
Compression compression = Compression.ZIP;
|
Compression compression = Compression.ZIP;
|
||||||
|
|
||||||
ArbitraryDataWriter arbitraryDataWriter = new ArbitraryDataWriter(Paths.get(directoryPath), name, service, null, method, compression);
|
ArbitraryDataWriter arbitraryDataWriter = new ArbitraryDataWriter(Paths.get(directoryPath), name, Service.WEBSITE, null, method, compression);
|
||||||
try {
|
try {
|
||||||
arbitraryDataWriter.save();
|
arbitraryDataWriter.save();
|
||||||
} catch (IOException | DataException | InterruptedException | MissingDataException e) {
|
} catch (IOException | DataException | InterruptedException | MissingDataException e) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user