Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble loading assets from localhost while doing development #25

Closed
sbesh91 opened this issue Jan 20, 2024 · 1 comment
Closed

Trouble loading assets from localhost while doing development #25

sbesh91 opened this issue Jan 20, 2024 · 1 comment

Comments

@sbesh91
Copy link
Contributor

sbesh91 commented Jan 20, 2024

I've been working with this library using an image pulled from S3 as a testing URL.

This image parses in just fine, but I'm running into an asset path parsing error when sending in a url that contains a port.

Ideally, I'd like to use pre-signed urls from S3 and that would look something like this.

The error I'm seeing so far looks like this.

/bevy_asset-0.12.1/src/path.rs:104:37: called `Result::unwrap()` on an `Err` value: InvalidSourceSyntax

I tracked down where I think this is being thrown to the while loop that parses paths looking for :. Since there is a second : in the url containing a path, it seems to throw that InvalidSourceSyntax error.

    while let Some((index, char)) = chars.next() {
          match char {
              ':' => {
                  let (_, char) = chars
                      .next()
                      .ok_or(ParseAssetPathError::InvalidSourceSyntax)?;
                  if char != '/' {
                      return Err(ParseAssetPathError::InvalidSourceSyntax);
                  }
                  let (index, char) = chars
                      .next()
                      .ok_or(ParseAssetPathError::InvalidSourceSyntax)?;
                  if char != '/' {
                      return Err(ParseAssetPathError::InvalidSourceSyntax);
                  }
                  source_range = Some(0..index - 2);
                  path_range.start = index + 1;
              }
              '#' => {
                  path_range.end = index;
                  label_range = Some(index + 1..asset_path.len());
                  break;
              }
              _ => {}
          }
      }
@sbesh91
Copy link
Contributor Author

sbesh91 commented Jan 26, 2024

Moved to bevy repo bevyengine/bevy#11533

@sbesh91 sbesh91 closed this as completed Jan 26, 2024
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

No branches or pull requests

1 participant