Skip to content

Commit

Permalink
Add .bgcode support
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilja Kartashov authored and voxelias committed Nov 21, 2023
1 parent 377e150 commit 1ac7e92
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions config.mini.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module.exports = (env, args) => {
const config = {
PRINTER_TYPE: "fdm",

FILE_EXTENSIONS: [".gcode", ".bgcode"],
WITH_STORAGES: ["usb"],
WITH_FILES: true,
WITH_SETTINGS: false,
Expand Down
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

0 comments on commit 1ac7e92

Please sign in to comment.