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
URL-encode dates using unix timestamp #2276
Merged
tanner0101
merged 19 commits into
vapor:master
from
thecheatah:bug/default-date-encoding-for-urlencodedform-to-unix-timestamp
Mar 30, 2020
Merged
URL-encode dates using unix timestamp #2276
tanner0101
merged 19 commits into
vapor:master
from
thecheatah:bug/default-date-encoding-for-urlencodedform-to-unix-timestamp
Mar 30, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…er isn't created for every encode/decode.
…g a `custom` DateFormat for `URLEncodedFormEncoder` or `URLEncodedFormDecoder`
…ustom(_:)` and `JSONEncoder.DateEncodingStrategy.custom(_:)` interfaces
…ttps://bugs.swift.org/browse/SR-7745?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aall-tabpanel I tried running the sample program with `10000000` iterations in the `vapor/swift:5.2` docker image without any issue.
…tervalSinceReferenceDate`
…IntervalSince1970`
tanner0101
reviewed
Mar 30, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 👍
tanner0101
approved these changes
Mar 30, 2020
tanner0101
changed the title
Bug/default date encoding for urlencodedform to unix timestamp
URL-encoded dates using unix timestamp
Mar 30, 2020
tanner0101
changed the title
URL-encoded dates using unix timestamp
URL-encode dates using unix timestamp
Mar 30, 2020
These changes are now available in 4.0.0-rc.3.12 |
thecheatah
deleted the
bug/default-date-encoding-for-urlencodedform-to-unix-timestamp
branch
March 30, 2020 18:15
pull bot
pushed a commit
to scope-demo/vapor
that referenced
this pull request
Mar 30, 2020
* Added ability to configure date coding/decoding for UrlEncodedForm * Added documentation to the `DateFormat` enum * renamed internetDateTime to iso8601 * Added custom date formatter * Added comment about `ISO8601DateFormatter` performance * Added ISO8601DateFormatter.threadSpecific so a new ISO8601DateFormatter isn't created for every encode/decode. * Use typealias instead of declaring DateFormat 2x * Added `ThreadSpecificDateFormatter` to ensure thread safety when using a `custom` DateFormat for `URLEncodedFormEncoder` or `URLEncodedFormDecoder` * Fixed comment * Changed custom interface to mimic `JSONDecoder.DateDecodingStrategy.custom(_:)` and `JSONEncoder.DateEncodingStrategy.custom(_:)` interfaces * Removed unused ThreadSpecificDateFormatter * `ISO8601DateFormatter` seems to be thread safe. This bug was filed: https://bugs.swift.org/browse/SR-7745?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aall-tabpanel I tried running the sample program with `10000000` iterations in the `vapor/swift:5.2` docker image without any issue. * Default the date format for URLEncodedFrom coding/decoding to `timeIntervalSinceReferenceDate` * Default to `timeIntervalSince1970` * Removed all references to customizing DateFormat and default to `timeIntervalSince1970` * Removed reference to `import NIO` and fixed spacing * Fixed spacing * Implemented using `extension Date: URLQueryFragmentConvertible` * Spacing
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes default
Date
url-encoding to use unix timestamps instead of Apple-specific reference (#2276).