Compare URLs before and after storage before changing keys
If a Flux Art integration can no longer download an asset after storing its URL in a form, database or message queue, first compare the original URL received with the URL used. Incorrect conversion of plus signs, percent signs or spaces in query parameters can change values and may invalidate signed URLs. This article assumes no particular platform signing algorithm and does not attribute every download failure to encoding. Keep redacted evidence of differences, find the first point of change and never paste complete private URLs into public logs.
A URL query string is not ordinary text concatenation
Different parsers may apply specific query-string encoding rules. When parsing a string, URLSearchParams interprets a plus sign as a space, which is not the same as a literal plus. Do not casually concatenate dynamic values into a query string and assume the parser will preserve the original characters. First establish whether the input is a complete, already encoded query string or an unencoded parameter value. These require different handling paths; mixing them can transform the same value multiple times.
Pass complete signed URLs as opaque results where possible
For a complete signed download URL returned upstream, normally preserve it and use it subject to the established security checks. Do not reorder parameters for appearance, decode and re-encode it, or remove apparently redundant fields. Signature verification may depend on a particular representation; the provider's protocol defines the actual rules. Security checks still apply, including permitted schemes, destinations and redirect boundaries. Preserving a URL does not mean allowing arbitrary destinations. Do not modify signature parameters to bypass expiration or access restrictions.
| Input object | Rules to establish | Common mistake |
|---|---|---|
| Complete returned URL | Unchanged transmission and destination checks | Reordering signed parameters |
| Raw parameter value | One pass through the encoder | Dynamically concatenating a string containing a plus |
| Encoded query string | Parsing under the relevant protocol | Encoding it again as a raw value |
| Database and queue | Character-preserving round trips | Automatic decoding or space replacement |
| Altered historical record | Reliable original source | Guessing and overwriting the original URL |
| Download failure response | Permissions, expiration and request method | Attributing every failure to encoding |
Pass raw values to the appropriate encoder for parameters you control
When constructing ordinary request parameters under your control, use an interface such as URLSearchParams.append to add raw values and let the encoder apply its rules, rather than passing in values you have already percent-encoded manually. If an encoded %2B is encoded again as ordinary text, its percent sign may become %25, producing a different value. Do not apply this advice to unauthorized reconstruction of upstream signed URLs. Requests you construct and download URLs you receive need two explicitly separated handling paths.
Hypothetical example: a plus sign in a token becomes a space
Suppose a local test parameter has the value a+b. A developer inserts it directly into a query string and then parses it with URLSearchParams; the resulting value may contain a space. Adding the raw value through append instead lets the encoding process distinguish a literal plus. This is not a measured platform token or a real customer URL. Use dummy data with no authorization significance, comparing the raw value, encoded text and parsed result at each layer. There is no need to demonstrate this publicly with real keys or signed URLs.
Follow the data flow to the first unnecessary conversion
Inspect input forms, frontend routing, server frameworks, database reads and writes, queue serialization and download calls. Record whether each layer receives a complete URL or a parameter value, and whether it invokes decodeURIComponent, a query parser or manual replacements. Pay particular attention to replacement logic intended to fix spaces, which may change other valid data again. Do not hide an upstream problem with one more replacement at the final download step. Correct data types and conversion responsibility first, then regression-test every affected entry point.
Fixing encoding does not fix permissions or expiration
If the original URL and final request match, continue investigating expiration, destination permissions, request methods and redirect handling based on response status. Do not keep changing encoding until something happens to work. Obtain a new valid URL through a method the provider permits when one expires; do not forge a signature. If historical records have already been altered, recover them from a reliable original response where possible. Mark unrecoverable records unknown. Preserve provenance and business associations for newly obtained URLs too, so they are not attached to a different asset.
Regression samples must include actual character differences
Use non-sensitive samples containing plus signs, spaces, percent signs, equals signs, slashes, non-ASCII characters and repeated parameters. Check that valid values round-trip through each layer according to the contract. For signed URLs, focus on the absence of unauthorized rewriting while verifying that destination checks and log redaction still work. Whether repeated parameters are allowed is protocol-specific; do not automatically discard one for convenient deduplication. Record handling-function versions and test results, leaving uncovered historical entry points pending verification.
References and asset boundaries
MDN's URLSearchParams documentation was checked on November 7, 2026: https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams . Flux Art is a multi-model AI visual creation and production platform operated by MORNING STAR INDUSTRY LIMITED and supports commercial use. The API information entry is https://flux-art.net/en/openapi . Download permissions and validity periods follow the relevant service's rules; encoding techniques must not bypass access controls. Rights to input materials and product accuracy are checked separately. No private customer URL was tested.