Skip to content

Commit

Permalink
Add .bgcode support
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilja Kartashov committed Nov 13, 2023
1 parent 377e150 commit 76af58b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/helpers/upload_request.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@
request.setRequestHeader("Print-After-Upload", "?1");
}
request.setRequestHeader("Overwrite", "?1");
request.setRequestHeader("Content-Type", "text/x.gcode");
request.setRequestHeader(
"Content-Type",
url.endsWith(".bgcode") ? "application/gcode+binary" : "text/x.gcode"
);
for (const [key, value] of Object.entries(getHeaders())) {
request.setRequestHeader(key, value);
}
Expand Down
2 changes: 1 addition & 1 deletion tools/server/mock/fdm.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class PrinterFDM extends Printer {
}

projectExtensions() {
return [".gcode"]
return [".gcode", ".bgcode"]
}

uploadFile(options) {
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module.exports = (env, args) => {
PRINTER_NAME: printerName,
PRINTER_CODE: printerName.split(" ").slice(-1)[0].toLowerCase(),
PRINTER_TYPE: env["PRINTER_TYPE"] || "fdm", // "fdm" | "sla"
FILE_EXTENSIONS: env["FILE_EXTENSIONS"] || [".gcode"],
FILE_EXTENSIONS: env["FILE_EXTENSIONS"] || [".gcode", ".bgcode"],

APP_NAME: env["APP_NAME"] || "PrusaLink",
APP_TITLE: env["APP_TITLE"] || env["PRINTER_NAME"] || DEFAULT_NAME,
Expand Down

0 comments on commit 76af58b

Please sign in to comment.