Files
floci/compatibility-tests/sdk-test-java/src
Matheus Oliveira 955a935bad fix(cloudfront): return the decoded function code from GetFunction (#6798)
* fix(cloudfront): return the decoded function code from GetFunction

GetFunction wrote the stored base64 text into the response body where
AWS returns the code the request carried, so reading back what you sent
gave different bytes. The body is the decoded code now, with the
octet-stream content type and the ETag header unchanged; the
CloudFormation provisioner base64-encodes the template's plain code so
the stored form stays the wire form, and GetFunction is the single
decode point.

Closes #6749

Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>

* fix(cloudfront): read a plain-code record persisted by an older Floci version

GetFunction served a 400 for a stored code that was not base64, and an
upgrade over persistent storage kept the records older Floci writes
wrote the CloudFormation provisioner as plain text, so those functions
stopped serving their code. A non-base64 record now reads back as its
stored bytes, and the next UpdateFunction rewrites it into the uniform
base64 form. The compat round-trip test captures the updated etag
before asserting so a failed assertion cannot hijack the cleanup's
delete.

Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>

* test(cloudfront): read the ETag update header the model names and rebase the decoded-code management tests

The decoded-code round trip asserts UpdateFunction answers the version
in the ETag header the SDK models name, so it reads the value it was
extracted from instead of null. The compat round-trip test uses AssertJ
like the rest of the compatibility module.

Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>

---------

Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
2026-10-30 14:57:30 -04:00
..