Skip to content

Conversation

@kbtxwer
Copy link

@kbtxwer kbtxwer commented Aug 25, 2024

  1. improve the body limit so that it can be able to send large files
  2. directly write the file to it path instead of using a tempfile to avoid the rename operation on windows because it is easy going wrong
  3. modified the "getMetadataGetHandler" function to keep the same performance as the FreeTAKServer
  4. use "ctx.BaseURL() + packageUrl(pi)" instead of "packageUrl(pi)" because my tak client cannot determine which server to connect when the url is not given as full path, even when there is only one server connected. The FreeTAKServer also returns the full path url.

Admin added 4 commits August 26, 2024 00:51
2. directly write the file to it path instead of using a tempfile to avoid the rename operation on windows because it is easy going wrong
3. modified the "getMetadataGetHandler" function to keep the same performance as the FreeTAKServer
4. use "ctx.BaseURL() + packageUrl(pi)" instead of "packageUrl(pi)" because my tak client cannot determine which server to connect when the url is not given as full path, even when there is only one server connected. The FreeTAKServer also returns the full path url.
…ile path which will raise 404 error during access from web

2. EMBED webtak into the program
3. register webTakPathHandler to redirect /webtak to /webtak/ to avoid issues
@kdudkov
Copy link
Owner

kdudkov commented Aug 27, 2024

  1. good point, tnx
  2. if upload fails we can loose file this way
  3. afaik getMetadataGet should return Tool field only, not file
  4. what is your tak client? ATAK/itak work well


addMartiRoutes(app, api.f)
} else {
staticfiles.EmbedWebTak(api.f)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't want to use /webtak handle at all if it's not a webtacRoot

}

func (c *PathUnescapeFs) Open(name string) (http.File, error) {
// 解码路径中的空格
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use english comments only

var staticFiles embed.FS

//go:embed webtak
var webtakFiles embed.FS
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not embed webtak in the binary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants