GridSpace / grid-apps

Browser-based Slicer for 3D Printing, CAM, Laser (Kiri:Moto) and mesh editor (Mesh:Tool)
https://grid.space/
MIT License
446 stars 141 forks source link

STL load `fetch` rewrite #220

Closed AlbertMN closed 1 year ago

AlbertMN commented 1 year ago

Use fetch instead of XHR & implement credentials parameter to allow credential / cookie sharing in requests.

stewartoallen commented 1 year ago

this doesn't parse the content disposition to extract the filename. should be easy to adapt lines 36-40 of the original code to do this

AlbertMN commented 1 year ago

@stewartoallen that should be the case with this line here; https://github.com/GridSpace/grid-apps/pull/220/commits/ab7e806b5cbb4d77d4da07cbc698eb94177c8602#diff-71dd6b11160ea3c8cf6590b3333161717ea829a22af616b4d5ea126c1cd581aeR38 - it's just more simple now.

stewartoallen commented 1 year ago

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition

specifically, the content of the header we need to parse out

Content-Disposition: attachment; filename="filename.jpg"

the line you highlighted returns the raw content of the header field

AlbertMN commented 1 year ago

Ah, I see - figured it just returned the filename, but you're right - fixing now.

AlbertMN commented 1 year ago

@stewartoallen done