COPY and MOVE #1602
Replies: 5 comments
-
Hmm, so these must be like method aliases since the standard methods have attached semantics. How do fastify know if a SEARCH aliases GET semantics or POST semantics or HEAD or whatever. Because the standard requires a particular behavior so cannot just be some random name. I would call it "method aliases" |
Beta Was this translation helpful? Give feedback.
-
The semantics are clearly defined in web standards, although SEARCH is relatively new. COPY and MOVE are part of webDAV. Just Google HTTP verbs COPY and MOVE.
COPY is effectively a GET followed by a PUT of the results without having to come back to the client and can thus be transactional.
MOVE is effectively a GET followed by PUT followed by a DELETE.
The standard specifies that the target of COPY and MOVE gets specified in a header, but it could easily be part of a query string.
Sent from my T-Mobile 5G Device
Get Outlook for Android<https://aka.ms/AAb9ysg>
…________________________________
From: uNetworkingAB ***@***.***>
Sent: Friday, May 5, 2023, 8:23 PM
To: uNetworking/uWebSockets ***@***.***>
Cc: Simon Y. Blackwell ***@***.***>; Author ***@***.***>
Subject: Re: [uNetworking/uWebSockets] COPY and MOVE (Discussion #1602)
Hmm, so these must be like method aliases since the standard methods have attached semantics. How do fastify know if a SEARCH aliases GET semantics or POST semantics or HEAD or whatever. Because the standard requires a particular behavior so cannot just be some random name. I would call it "method aliases"
—
Reply to this email directly, view it on GitHub<#1602 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABF2US23KFDGJXHB22CB4X3XEW7ZJANCNFSM6AAAAAAXXUFQNI>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
So, we just add "SEARCH", "COPY" and "MOVE" to the router and that's good for now? |
Beta Was this translation helpful? Give feedback.
-
I am actually OK with them just being valid method names/verbs so they can get passed in for handling by .any routes. If methods .search, .copy, .move also get added, even better. Fastify essentially does the first but not the second.
It could be that just updating HttpRouter.h would do the trick. Not sure how the code base decides what to hand off to the router. As an alternative, an options argument might be provided to App that's let's developers add other verbs (there are plenty more in other standards).
upperCasedMethods = {"GET", "POST", "HEAD", "PUT", "DELETE", "CONNECT", "OPTIONS", "TRACE", "PATCH", "SEARCH", "COPY", "MOVE"};
Sent from my T-Mobile 5G Device
Get Outlook for Android<https://aka.ms/AAb9ysg>
…________________________________
From: uNetworkingAB ***@***.***>
Sent: Friday, May 5, 2023, 11:43 PM
To: uNetworking/uWebSockets ***@***.***>
Cc: Simon Y. Blackwell ***@***.***>; Author ***@***.***>
Subject: Re: [uNetworking/uWebSockets] COPY and MOVE (Discussion #1602)
So, we just add "SEARCH", "COPY" and "MOVE" to the router and that's good for now?
—
Reply to this email directly, view it on GitHub<#1602 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABF2US5MCNP5KALVSERJVADXEXXJDANCNFSM6AAAAAAXXUFQNI>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Looking at the source it seems extending the verbs to include COPY, MOVE, and SEARCH would be relatively straight forward assuming they were not added to the router and had to be processed with .any routes. We are porting a fastify app which supports these methods. COPY and MOVE are particularly useful. The lack of SEARCH is easy to overcome with GET; however, requiring clients to use specialized POST requests for COPY and MOVE is far from ideal. As it is, COPY, MOVE, and SEARCH do not make it through to .any routes because they are not supported at the C/C++ level.
Beta Was this translation helpful? Give feedback.
All reactions