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

New noCache() method #418

Closed
wants to merge 2 commits into from
Closed

New noCache() method #418

wants to merge 2 commits into from

Conversation

JamoCA
Copy link
Contributor

@JamoCA JamoCA commented Oct 12, 2021

Adds expiration headers to the response.

Resolves #416

Adds expiration headers to the response.
core/baseSerializer.cfc Show resolved Hide resolved
"Last-Modified" = dateFormat(nowUtc, "ddd, d mmm yyyy") & " " & timeFormat(nowUtc, "HH:mm:ss") & " GMT",
"Expires" = "Mon, 26 Jul 1997 05:00:00 EST"
}>
<cfset addHeaders(headers) />
Copy link
Owner

Choose a reason for hiding this comment

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

I don't see this function addHeaders defined anywhere. Am I missing something?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

addHeaders()? I don't make that up. It's already one of your existing methods in api.cfc (line 1441).

https://github.com/atuttle/Taffy/blob/main/core/api.cfc#L1441

	<cffunction name="addHeaders" access="public" output="false" returntype="void">
		<cfargument name="headers" type="struct" required="true" />
		<cfset var h = '' />
		<cfif !structIsEmpty(arguments.headers)>
			<cfloop list="#structKeyList(arguments.headers)#" index="h">
				<cfset addHeader(name="#h#", value="#arguments.headers[h]#") />
			</cfloop>
		</cfif>
	</cffunction>

Copy link
Owner

Choose a reason for hiding this comment

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

Ah, but being in Application.cfc doesn't make it available to serializers...

@atuttle atuttle added the Semver-Minor This change will necessitate a minor version bump label Jan 14, 2022
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Semver-Minor This change will necessitate a minor version bump
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants