CA3153431A1 - Http redirect status code capture method and apparatus, and computer device - Google Patents
Http redirect status code capture method and apparatus, and computer deviceInfo
- Publication number
- CA3153431A1 CA3153431A1 CA3153431A CA3153431A CA3153431A1 CA 3153431 A1 CA3153431 A1 CA 3153431A1 CA 3153431 A CA3153431 A CA 3153431A CA 3153431 A CA3153431 A CA 3153431A CA 3153431 A1 CA3153431 A1 CA 3153431A1
- Authority
- CA
- Canada
- Prior art keywords
- status code
- response message
- message
- redirecting
- response
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 60
- 230000004044 response Effects 0.000 claims abstract description 334
- 235000014510 cooky Nutrition 0.000 claims description 43
- 238000004590 computer program Methods 0.000 claims description 37
- 238000012216 screening Methods 0.000 claims description 37
- 230000015654 memory Effects 0.000 claims description 31
- 239000003795 chemical substances by application Substances 0.000 description 16
- 238000012545 processing Methods 0.000 description 9
- 230000008569 process Effects 0.000 description 6
- 230000009466 transformation Effects 0.000 description 5
- 238000004891 communication Methods 0.000 description 4
- 238000010586 diagram Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 238000009434 installation Methods 0.000 description 2
- 230000001360 synchronised effect Effects 0.000 description 2
- 238000012546 transfer Methods 0.000 description 2
- 230000001413 cellular effect Effects 0.000 description 1
- 230000008094 contradictory effect Effects 0.000 description 1
- 238000013497 data interchange Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000009977 dual effect Effects 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000000977 initiatory effect Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/08—Protocols for interworking; Protocol conversion
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Computer And Data Communications (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The present application relates to a HTTP redirect status code capture method and apparatus, and a computer device. The method comprises: obtaining a first status code, the first status code being a status code in a response header of a first response message, the first response message being a HTTP response message returned by a service system after a HTTP request is initiated to the service system; when the first status code is a redirect status code, constructing a second response message according to a preset message protocol format and the first status code, the first status code being carried in a message body of the second response message; returning the second response message, the second response being used to instruct a receiving side to obtain a redirect status code according to a message protocol format. The present method allows a small program end to capture a redirect status code, and can also reduce delay.
Description
HTTP REDIRECT STATUS CODE CAPTURE METHOD AND APPARATUS, AND
COMPUTER DEVICE
BACKGROUND OF THE INVENTION
Technical Field [0001] The present application relates to the field of internet technology, and more particularly to a method and a device for capturing an Http redirecting status code, and corresponding computer equipment and storage medium.
Description of Related Art
COMPUTER DEVICE
BACKGROUND OF THE INVENTION
Technical Field [0001] The present application relates to the field of internet technology, and more particularly to a method and a device for capturing an Http redirecting status code, and corresponding computer equipment and storage medium.
Description of Related Art
[0002] With the development of the intemet technology, the applet technology has come into being. An applet is an application program carried in any other platform (such as the WeChat platform, Baidu platform or TouTiao platform) and ready for use in the platform without prior downloading and installation.
[0003] Out of considerations for security, it is required in the Web system by many requests that the user be in a login status (referred to as constrained resource). It is modus operandi while processing the constrained resource to jump perforce to the login page when it is determined that the user is not in the login status. However, since the underlying request of an applet is not like a browser request, the request of the applet does not support Http (Hypertext transfer protocol) redirecting status codes. The conventional solving scheme is to firstly invoke the interface of the server end to judge the login status of the user. With respect to the applet end, since all requests would be each added with another request to judge whether the user has logged in, such additional requests necessarily cause delay of the response.
SUMMARY OF THE INVENTION
SUMMARY OF THE INVENTION
[0004] In view of the aforementioned technical problems, there is an urgent need to provide a method and a device for capturing an Http redirecting status code, and corresponding Date Recue/Date Received 2022-03-04 computer equipment and storage medium capable of reducing delay.
[0005] There is provided a method of capturing an Http redirecting status code, and the method comprises:
[0006] obtaining a first status code, wherein the first status code is a status code in a response header of a first response message, and the first response message is an Http response message returned by a business system after an Http request has been initiated to the business system;
[0007] constructing a second response message according to a preset message protocol format and the first status code when the first status code is a redirecting status code, wherein the first status code is carried in a message body of the second response message; and
[0008] returning the second response message, wherein the second response is for instructing a receiver to obtain the redirecting status code according to the message protocol format.
[0009] In one embodiment, the message header of the second response message carries therein a second status code, wherein the second status code is a status code supported by the receiver and different from the first status code.
[0010] In one embodiment, the step of constructing a second response message according to a preset message protocol format and the first status code when the first status code is a redirecting status code includes: obtaining network location information in the response header of the first response message when the first status code is a redirecting status code;
and constructing the second response message according to the preset message protocol format, the first status code and the network location information, wherein the message body of the second response message further carries therein the network location information.
and constructing the second response message according to the preset message protocol format, the first status code and the network location information, wherein the message body of the second response message further carries therein the network location information.
[0011] In one embodiment, the step of constructing a second response message according to a preset message protocol format and the first status code when the first status code is a Date Recue/Date Received 2022-03-04 redirecting status code includes: obtaining network location information in the response header of the first response message and Cookie data in the response header of the first response message when the first status code is a redirecting status code; and constructing the second response message according to the preset message protocol format, the first status code, the network location information and the Cookie data, wherein the message body of the second response message further carries therein the network location information and the Cookie data.
[0012] In one embodiment, the method further comprises:
[0013] screening the received response message according to preset user agent screening rule or/and description information screening rule; and
[0014] taking the received response message as the first response message when the received response message satisfies the user agent screening rule or/and the description information screening rule, and entering the step of obtaining a first status code.
[0015] In one embodiment, the method further comprises:
[0016] returning the first response message when the first status code is a non-redirecting status code.
[0017] In one embodiment, the method is applied to a gateway, wherein the receiver is a terminal, on which an applet application is operative, wherein the applet application obtains the redirecting status code according to the message protocol format.
[0018] There is provided a method of capturing an Http redirecting status code, and the method comprises:
[0019] receiving a response message; and
[0020] obtaining, when it is determined that the received response message is a second response message, a redirecting status code carried in a message body of the second response message according to a preset message protocol format, wherein the redirecting status Date Recue/Date Received 2022-03-04 code is a first status code, and the second response message is constructed according to the message protocol format and the first status code.
[0021] There is provided a device for capturing an Http redirecting status code, and the device comprises:
[0022] a status code obtaining module, for obtaining a first status code, wherein the first status code is a status code in a response header of a first response message, and the first response message is an Http response message returned by a business system after an Http request has been initiated to the business system;
[0023] a message constructing module, for constructing a second response message according to a preset message protocol format and the first status code when the first status code is a redirecting status code, wherein the first status code is carried in a message body of the second response message; and
[0024] a returning module, for returning the second response message, wherein the second response is for instructing a receiver to obtain the redirecting status code according to the message protocol format.
[0025] There is provided a computer equipment that comprises a memory, a processor and a computer program stored on the memory and operable on the processor, and the following steps are realized when the processor executes the computer program:
[0026] obtaining a first status code, wherein the first status code is a status code in a response header of a first response message, and the first response message is an Http response message returned by a business system after an Http request has been initiated to the business system;
[0027] constructing a second response message according to a preset message protocol format and the first status code when the first status code is a redirecting status code, wherein the first status code is carried in a message body of the second response message; and
[0028] returning the second response message, wherein the second response is for instructing a receiver to obtain the redirecting status code according to the message protocol format.
Date Recue/Date Received 2022-03-04
Date Recue/Date Received 2022-03-04
[0029] There is provided a computer equipment that comprises a memory, a processor and a computer program stored on the memory and operable on the processor, and the following steps are realized when the processor executes the computer program:
[0030] receiving a response message; and
[0031] obtaining, when it is determined that the received response message is a second response message, a redirecting status code carried in a message body of the second response message according to a preset message protocol format, wherein the redirecting status code is a first status code, and the second response message is constructed according to the message protocol format and the first status code.
[0032] There is provided a computer-readable storage medium storing a computer program thereon, and the following steps are realized when the computer program is executed by a processor:
[0033] obtaining a first status code, wherein the first status code is a status code in a response header of a first response message, and the first response message is an Http response message returned by a business system after an Http request has been initiated to the business system;
[0034] constructing a second response message according to a preset message protocol format and the first status code when the first status code is a redirecting status code, wherein the first status code is carried in a message body of the second response message; and
[0035] returning the second response message, wherein the second response is for instructing a receiver to obtain the redirecting status code according to the message protocol format.
[0036] There is provided a computer-readable storage medium storing a computer program thereon, and the following steps are realized when the computer program is executed by a processor:
[0037] receiving a response message; and
[0038] obtaining, when it is determined that the received response message is a second response Date Recue/Date Received 2022-03-04 message, a redirecting status code carried in a message body of the second response message according to a preset message protocol format, wherein the redirecting status code is a first status code, and the second response message is constructed according to the message protocol format and the first status code.
[0039] In the aforementioned method and device for capturing an Http redirecting status code, and corresponding computer equipment and storage medium, a first status code is obtained, which is a status code in a response header of a first response message, wherein the first response message is an Http response message returned by a business system after an Http request has been initiated to the business system; a second response message is constructed according to a preset message protocol format and the first status code when the first status code is a redirecting status code, wherein the first status code is carried in a message body of the second response message; and the second response message is returned, wherein the second response is for instructing a receiver to obtain the redirecting status code according to the message protocol format. In one embodiment of the present application, response message transformation is performed according to a preset message protocol format, so that the redirecting status code originally not supported by the receiver is carried in the message body of the second response message, whereby the second response message is obtained, and it is possible for the receiver (such as an applet end) to obtain the redirecting status code according to the message protocol format. Thusly, it is no longer required to invoke the interface of the server end to judge the login status of the user, and this on the one hand reduces the frequency for invoking the interface to judge the login status of the user, and on the other hand also reduces response delay and enhances user experience.
BRIEF DESCRIPTION OF THE DRAWINGS
BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Fig. 1-1 is a view illustrating the application environment for a method of capturing an Http redirecting status code in an embodiment;
Date Recue/Date Received 2022-03-04
Date Recue/Date Received 2022-03-04
[0041] Fig. 1-2 is a view illustrating the application environment for a method of capturing an Http redirecting status code in an embodiment;
[0042] Fig. 2 is a flowchart schematically illustrating a method of capturing an Http redirecting status code in an embodiment;
[0043] Fig. 3 is a flowchart schematically illustrating a step of constructing the second response message in an embodiment;
[0044] Fig. 4 is a flowchart schematically illustrating a step of constructing the second response message in another embodiment;
[0045] Fig. 5 is a flowchart schematically illustrating a method of capturing an Http redirecting status code in another embodiment;
[0046] Fig. 6 is a flowchart schematically illustrating a method of capturing an Http redirecting status code in still another embodiment;
[0047] Fig. 7 is a flowchart schematically illustrating a method of capturing an Http redirecting status code in yet another embodiment;
[0048] Fig. 8 is a block diagram illustrating the structure of a device for capturing an Http redirecting status code in an embodiment;
[0049] Fig. 9 is a block diagram illustrating the structure of a device for capturing an Http redirecting status code in another embodiment;
[0050] Fig. 10 is a view illustrating the internal structure of a computer equipment in an Date Recue/Date Received 2022-03-04 embodiment;
[0051] Fig. 11 is a view illustrating the internal structure of a computer equipment in another embodiment; and
[0052] Fig. 12 is a view illustrating the internal structure of a computer equipment in still another embodiment.
DETAILED DESCRIPTION OF THE INVENTION
DETAILED DESCRIPTION OF THE INVENTION
[0053] To make more lucid and clear the objectives, technical solutions and advantages of the present application, the present application is described in greater detail below with reference to accompanying drawings and embodiments. As should be understood, the specific embodiments as described here are merely meant to explain the present application, rather than to restrict the present application.
[0054] As can be understood, the wordings "first" and "second" as used in the present application are usable in this paper to describe various elements, but these elements are not restricted by such wordings, as such wordings are merely meant to differentiate a first element from another. For instance, the first client end can be referred to as the second client end without departing from the scope of the present application, similarly, the second client end can as well be referred to as the first client end. Both the first client end and the second client end are client ends, but are not the same client end. As can be additionally understood, the wording "or/and" as used in the present application describes the association relation of associated objects, and expresses the existence of three possible relations, for instance, A or/and B can express the three circumstances: the single existence of A, the simultaneous existence of A and B, and the single existence of B. The sign "/" generally expresses the relation of "or" between the associated objects before the sign and after the sign.
Date Recue/Date Received 2022-03-04
Date Recue/Date Received 2022-03-04
[0055] The method of capturing an Http redirecting status code provided by the present application is applicable to the application environment as shown in Fig. 1-1.
The application environment includes terminal 102, network 104 and business system 106, wherein terminal 102 and business system 106 can be communicably connected via network 104. The network system consisting of terminal 102, network 104 and server 106 can be based either on the internet or on a local area network, and can be further based on a combined network based both on the internet and the local area network, to which no explanation is redundantly made in this context.
The application environment includes terminal 102, network 104 and business system 106, wherein terminal 102 and business system 106 can be communicably connected via network 104. The network system consisting of terminal 102, network 104 and server 106 can be based either on the internet or on a local area network, and can be further based on a combined network based both on the internet and the local area network, to which no explanation is redundantly made in this context.
[0056] Terminal 102 can be, but is not limited to be, any of various personal computers, notebook computers, smart mobile phones, panel computers and portable wearable devices.
What is shown in Fig. 1-1 is the case in which terminal 102 includes two terminals, namely terminal 1022 and terminal 1024, but the present application makes no restriction to the number of terminal(s) 102, as more or less terminal(s) can as well be included. An applet application operative on terminal 102 is an application useable without prior downloading and installation, such as a WeChat applet operative under WeChat environment or a Baidu applet operative under Baidu environment.
What is shown in Fig. 1-1 is the case in which terminal 102 includes two terminals, namely terminal 1022 and terminal 1024, but the present application makes no restriction to the number of terminal(s) 102, as more or less terminal(s) can as well be included. An applet application operative on terminal 102 is an application useable without prior downloading and installation, such as a WeChat applet operative under WeChat environment or a Baidu applet operative under Baidu environment.
[0057] Network 104 is used to realize network connection between terminal 102 and business system 106, and can include plural types of wired or wireless networks.
Terminal 104 can include the internet, a local area network ("LAN"), a wide area network ("WAN"), an intranet, a mobile telephone network, a virtual private network (VPN), a cellular or any other type of mobile communication network, the Bluetooth, NFC or any combination thereof. Network 104 is also based on a corresponding communication protocol while transmitting data, for instance, the HTTP communication protocol will be the basis when a webpage browser receives business codes corresponding to the webpage, and the Websocket communication protocol can be the basis when a mobile application program receives business codes.
Date Recue/Date Received 2022-03-04
Terminal 104 can include the internet, a local area network ("LAN"), a wide area network ("WAN"), an intranet, a mobile telephone network, a virtual private network (VPN), a cellular or any other type of mobile communication network, the Bluetooth, NFC or any combination thereof. Network 104 is also based on a corresponding communication protocol while transmitting data, for instance, the HTTP communication protocol will be the basis when a webpage browser receives business codes corresponding to the webpage, and the Websocket communication protocol can be the basis when a mobile application program receives business codes.
Date Recue/Date Received 2022-03-04
[0058] Business system 106 can include one or more server(s), for example, what is shown in Fig. 1-1 is the case in which business system 106 includes two servers, namely server 1062 and server 1064, but the present application makes no restriction to the number of server(s), as more or less server(s) can as well be included. Each server can be embodied as an independent server or a server cluster consisting of a plurality of servers.
[0059] The method of capturing an Http redirecting status code provided by the present application is further applicable to the application environment as shown in Fig. 1-2. This application environment can further include gateway 108 besides terminal 102, network 104 and business system 106 as shown in Fig. 1-1. Gateway 108 is deployed at a gateway layer, and the gateway layer is usually the layer previous to the WEB server.
As a computer equipment, gateway 108 uniformly performs transformation of response messages with respect to redirected responses of the business system to applets operative on various terminals, so as to ensure that the applets operative on various terminals can respond to redirecting status codes of the business system. In addition, there can as well be plural business systems 106. The plural business systems 106 correspond to the same and single gateway.
As a computer equipment, gateway 108 uniformly performs transformation of response messages with respect to redirected responses of the business system to applets operative on various terminals, so as to ensure that the applets operative on various terminals can respond to redirecting status codes of the business system. In addition, there can as well be plural business systems 106. The plural business systems 106 correspond to the same and single gateway.
[0060] In one embodiment, as shown in Fig. 2, there is provided a method of capturing an Http redirecting status code, and the method is explained with an example of its being applied to the gateway in Fig. 1-2, to comprise the following steps.
[0061] Step 202 - obtaining a first status code, wherein the first status code is a status code in a response header of a first response message, and the first response message is a response message returned by a business system after an Http request has been initiated to the business system.
[0062] The status code here usually means a three-digit code allocated to a received request (such Date Recue/Date Received 2022-03-04 as webpage clicking), and is usually an Http status code that is a three-digit code used to express the hypertext transfer protocol response status of a webpage server.
Here, the Http request is for requesting a first response message.
Here, the Http request is for requesting a first response message.
[0063] Specifically, after the terminal (or in other words, an applet operative on the terminal) has sent a business request to the business system, the business system obtains a first response message according to the business request; the gateway initiates an Http request to the business system to obtain the first response message, and obtains a status code, namely the first status code, in the response header of the first response message after having obtained the first response message.
[0064] Step 204 - constructing a second response message according to a preset message protocol format and the first status code when the first status code is a redirecting status code, wherein the first status code is carried in a message body of the second response message.
[0065] Here, the redirecting status code usually indicates any status code relevant to redirection in Http status codes, such as status codes 301, 302, 303, and 307. By redirecting is meant to relocate various network requests to other locations by various methods, for example, webpage redirecting or domain name redirecting.
[0066] The message protocol format here is the format of a message protocol previously agreed upon by the gateway and downstream receivers, and the message protocol format at least includes the configuration mode of the first status code.
[0067] Specifically, the gateway firstly judges whether the first status code is a redirecting status code, if yes, constructs the second response message according to the preset message protocol format and the first status code, wherein the first status code is carried in a message body of the second response message. As required, the process of judging whether the first status code is a redirecting status code can also be completed via any Date Recue/Date Received 2022-03-04 other equipment, and the gateway obtains the judging result.
[0068] Step 206 - returning the second response message, wherein the second response is for instructing a receiver to obtain the redirecting status code according to the message protocol format.
[0069] Specifically, the gateway returns the second response message to the terminal (or in other words, an applet operative on the terminal). In the aforementioned method of capturing an Http redirecting status code, a first status code is obtained, wherein the first status code is a status code in a response header of a first response message, the first response message is an Http response message returned by a business system after an Http request has been initiated to the business system. A second response message is constructed according to a preset message protocol format and the first status code when the first status code is a redirecting status code, wherein the first status code is carried in a message body of the second response message. The second response message is returned, wherein the second response is for instructing a receiver to obtain the redirecting status code according to the message protocol format. In this embodiment, response message transformation is performed according to a preset message protocol format, so that the redirecting status code originally not supported by the receiver is carried in the message body of the second response message, whereby the second response message is obtained, and it is possible for the receiver (such as an applet end) to obtain the redirecting status code according to the message protocol format. Thusly, it is no longer required to invoke the interface of the server end to judge the login status of the user, and this on the one hand reduces the frequency for invoking the interface to judge the login status of the user, and on the other hand also reduces response delay and enhances user experience.
[0070] In one embodiment, the message header of the second response message carries therein a second status code, wherein the second status code is a status code supported by the receiver and different from the first status code.
Date Recue/Date Received 2022-03-04
Date Recue/Date Received 2022-03-04
[0071] Here, the second status code can be status code 200 that represents status codes having successfully processed requests. As required, the second status code can also be any status code other than status code 200, for example, status code 2xx.
[0072] In one embodiment, as shown in Fig. 3, the step of constructing a second response message according to a preset message protocol format and the first status code when the first status code is a redirecting status code can include the following steps.
[0073] Step 302 - obtaining network location information in the response header of the first response message when the first status code is a redirecting status code.
[0074] Here, the network location information can also be referred to as webpage address information that is a standard resource address on the internet. The network location information is usually the location in the response header of the response message.
[0075] Specifically, the gateway first judges whether the first status code is a redirecting status code, if yes, then obtains the network location information in the response header of the first response message.
[0076] Step 304 - constructing the second response message according to the preset message protocol format, the first status code and the network location information, wherein the message body of the second response message further carries therein the network location information.
[0077] Here, the message protocol format further includes the configuration mode of the message protocol format. The network location information serves as the redirecting webpage address information (redirectUr1).
Date Recue/Date Received 2022-03-04
Date Recue/Date Received 2022-03-04
[0078] Specifically, the gateway can configure the first status code and the network location information in the message body of the second response message according to the preset message protocol format. Generally, it is possible to configure the first status code and the network location information in the same and single message body, and it is also possible, with respect to the circumstance in which the same and single response message includes a plurality of message bodies, to configure the first status code and the network location information in different message bodies.
[0079] Since the message body of the second response message further carries therein the network location information, use of the solution according to this embodiment facilitates the terminal (or in other words, an applet operative on the terminal) to initiate invoking for modifying the network location information (namely redirecting).
[0080] Since consideration is given to the fact that it is generally required to carry the cookie of the previous request while requesting redirection, in one embodiment, as shown in Fig. 4, the step of constructing a second response message according to a preset message protocol format and the first status code when the first status code is a redirecting status code can include the following steps.
[0081] Step 402 - obtaining network location information in the response header of the first response message and Cookie data in the response header of the first response message when the first status code is a redirecting status code.
[0082] Cookie, whose plural form of Cookies is sometimes also used, means (usually encrypted) data stored by some websites on local user terminals to distinguish user identifications and perform session tracking.
[0083] Step 404 - constructing the second response message according to the preset message protocol format, the first status code, the network location information and the Cookie Date Recue/Date Received 2022-03-04 data, wherein the message body of the second response message further carries therein the network location information and the Cookie data.
[0084] Use of the solution according to this embodiment further facilitates the terminal (or in other words, an applet operative on the terminal) to initiate invoking for modifying the network location information.
[0085] In one embodiment, as shown in Fig. 5, there is provided a method of capturing an Hap redirecting status code, and the method is explained with an example of its being applied to the gateway in Fig. 1, to comprise the following steps.
[0086] Step 502 - screening the received response message according to preset user agent screening rule or/and description information screening rule.
[0087] Both the user agent screening rule and the description information screening rule can be set according to practical requirements. For instance, a user agent identification collection is set, if the user agent identification to which the received response message corresponds is one in the user agent identification collection, it is determined that the user agent screening rule is satisfied. For instance, it is also possible to set a description information collection, if the description information to which the received response message corresponds is matched with any piece of description information in the description information collection, it is determined that the description information screening rule is satisfied.
[0088] Step 504 - taking the received response message as the first response message when the received response message satisfies the user agent screening rule or/and the description information screening rule.
[0089] Step 506 - obtaining a first status code, wherein the first status code is a status code in a Date Recue/Date Received 2022-03-04 response header of a first response message, and the first response message is a response message returned by a business system after an Http request has been initiated to the business system.
[0090] Step 508 - constructing a second response message according to a preset message protocol format and the first status code when the first status code is a redirecting status code, wherein the first status code is carried in a message body of the second response message.
[0091] Step 510 - returning the second response message, wherein the second response is for instructing a receiver to obtain the redirecting status code according to the message protocol format.
[0092] Reference can be correspondingly made to the descriptions to the aforementioned steps 202, 204 and 206 for steps 506, 508 and 510 in this embodiment, and no repetition is redundantly made in this context.
[0093] The received response message is filtered in this embodiment, whereby the flow consumed by the applet can be economized.
[0094] In one embodiment, the method of capturing an Http redirecting status code according to the present application can further include the step of returning the first response message when the first status code is a non-redirecting status code.
[0095] Here, the non-redirecting status code means a status code that is irrelevant to redirection.
[0096] In this embodiment, when the first status code is a non-redirecting status code, the first response message is not modified, but directly returned to the receiver. It suffices for the receiver to process the directly returned first response message according to the original business processing logic.
Date Recue/Date Received 2022-03-04
Date Recue/Date Received 2022-03-04
[0097] As should be noted, all of the aforementioned embodiments are exemplified by applying the method of capturing an Http redirecting status code of the present application to a gateway, and are described with the receiver being a terminal, on which is operative an applet application that obtains the redirecting status codes according to the message protocol format. However, as practically required, it is also possible to apply the method of capturing an Http redirecting status code in the aforementioned embodiments to the business system or one or more server(s) of the business system in Fig. 1-1 or Fig. 1-2, that is to say, the execution subject of the various steps in the aforementioned various embodiments is the business system or one or more server(s) of the business system.
[0098] As for the application to a gateway, the gateway can be enabled to uniformly perform transformation of response messages with respect to redirected responses of the various applets, so as to ensure that the applets operative on various terminals can respond to redirecting status codes of the business system. This on the one hand makes it unnecessary to invoke the interface of the server end to judge the login status of the user, so there is no intrusion to the business on the server end, and on the other hand also unnecessary to separately configure each server to realize transformation of redirected responses, so configuration cost can be saved.
[0099] Based on the method of capturing an Http redirecting status code in the aforementioned embodiments, in one embodiment, as shown in Fig. 6, there is provided a method of capturing an Http redirecting status code, and the method is explained with an example of its being applied to the terminal, on which an applet application is operative, in Fig. 1-1 or Fig. 1-2, to comprise the following steps:
[0100] Step 602 - receiving a response message; and
[0101] Step 604 - obtaining, when it is determined that the received response message is a second response message, a redirecting status code carried in a message body of the second response message according to a preset message protocol format, wherein the redirecting Date Recue/Date Received 2022-03-04 status code is a first status code, and the second response message is constructed according to the message protocol format and the first status code.
[0102] In addition, when it is determined that the received response message is a first response message, processing is performed according to the original logic by which the applet application processes the first response message.
[0103] When the message body of the second response message further carries therein the network location information, a redirecting request can be initiated according to the network location information; when the message body of the second response message further carries therein the Cookie data, the response header of the initiated redirecting request carries the Cookie data.
[0104] As for a specific definition to the method of capturing an Http redirecting status code at the terminal side, reference can be made to the aforementioned definition to the method of capturing an Http redirecting status code at the gateway side, while no mention is made thereto in this context.
[0105] To facilitate comprehension of the solution of the present invention, explanation is made below with an example of interaction between the gateway and an applet application (hereinafter referred to as the applet end).
[0106] The message protocol format in this embodiment is: {"code":
"redirecting status code", "redirectUr1": "Location", "cookie": "Cookie"}, a protocol is made at the same time, when the downstream business system returns the redirecting status code, it is constrained that the returning result be a message protocol of the json format, namely the message protocol format, in which json is a lightweight data interchange format.
"redirecting status code", "redirectUr1": "Location", "cookie": "Cookie"}, a protocol is made at the same time, when the downstream business system returns the redirecting status code, it is constrained that the returning result be a message protocol of the json format, namely the message protocol format, in which json is a lightweight data interchange format.
[0107] The code in the message protocol format is a status code (Status), such as 301, 302, inside Date Recue/Date Received 2022-03-04 the response header that requests the business system to come up with redirection. The redirectUrl is the network location information (Location) inside the response header that requests the business system to come up with redirection. The cookie is the Cookie inside the response header that requests the business system to come up with redirection.
[0108] The applet unified gateway (equivalent to the aforementioned gateway) can be established by means of OpenResty(nginx+lua), the gateway layer is used by the applet, the flow of the applet can be restricted at the unified access layer through user agent (userAgent) and description information (refer) to arrive at the applet unified gateway, the gateway layer uses an httpc library to invoke the downstream business system interface and analyzes to obtain the response header of the business system interface, and returns the status code, the network location information and the Cookie inside the response header into the message body of the response message according to the aforementioned message protocol format when the response code inside the response header is a redirecting status code, wherein the status code given to the response message is 200. The code is a response status code marking the actual business, redirectUrl is Location inside the redirecting response header to facilitate the applet to initiate invoking of the URL for next time, and cookie is the cookie inside the response header of the first request, because the cookie of the previous request should be carried when redirecting (redirectUrl) is requested.
[0109] The applet end learns through the code in the returned message of json format that the business system actually returns a status code, finds that the status code is a redirecting status code, then places the Cookie inside the message of json format into the request header, requests the redirectUrl address inside json, and hence obtains returned business data.
[0110] The gateway layer can employ httpc of nginx+lua to initiate the http request of the business system, as shown in Fig. 7, the method of capturing an Http redirecting status Date Recue/Date Received 2022-03-04 code in this embodiment can include the following steps.
[0111] Step 702 ¨ by the gateway judging whether the status code in the response message of the business system is a redirecting status code, if yes, entering step 704, if not, entering step 706.
[0112] Here, the response message of the business system corresponds to the aforementioned first message. Specifically, the applet end sends a business request to the business system, the business system obtains a response message according to the business request, and the gateway requests the response message from the business system.
Specifically, the gateway can use httpclient to invoke interface URL of the business system. The gateway layer obtains the status code inside the response header of the response message of the business system, and judges whether it is a status code relevant to redirection (301, 302, 303, 307, etc.).
Specifically, the gateway can use httpclient to invoke interface URL of the business system. The gateway layer obtains the status code inside the response header of the response message of the business system, and judges whether it is a status code relevant to redirection (301, 302, 303, 307, etc.).
[0113] Step 704 ¨ by the gateway obtaining the status code, network location information and Cookie inside the response header of the response message of the business system, and constructing, on basis of the corresponding values, and returning a message with status code 200 according to an agreed message protocol format.
[0114] Specifically, it is possible to obtain the status code (Status), network location information (Location) and Cookie inside the response header of the response message of the business system, to construct a message with status code 200: {"code": "redirecting status code", "redirectUr1": "Location", "cookie"Cookie"}, based on the corresponding values of the status code, network location information and Cookie, according to an agreed protocol format, and to return the message.
[0115] Step 706¨ by the gateway returning the response message of the business system.
Date Recue/Date Received 2022-03-04
Date Recue/Date Received 2022-03-04
[0116] Specifically, if the status code is a non-redirecting status code, the gateway returns the response message of the business system.
[0117] Step 708 ¨ at the applet end receiving the response message sent by the gateway, and analyzing response header information of the received response message.
[0118] There are two analyzing results: 1. normal non-redirected response; and 2. redirected response of the original business processed by the gateway, namely a redirecting protocol, with the format: {"code": "redirecting status code", "redirectUr1":
"Location", "cookie"Cookie"}.
"Location", "cookie"Cookie"}.
[0119] Step 710 ¨ when a non-redirected response message is received at the applet end, processing according to the business processing logic to which the response message corresponds.
[0120] Step 712¨ when a redirected response message is received at the applet end, initiating a redirecting request according to the network location information in the message body of the response message.
[0121] The cookie is disposed in the request header of the redirecting request, and a redirecting request is initiated with the network location information in the message body of the response message as the new address information.
[0122] A set of protocols is stipulated to solve the problem that the applet does not support the http redirecting status code. A gateway layer established by means of OpenResty(nginx+lua) is employed to capture the http redirecting status code, the constraint protocol {"code": "redirecting status code", "redirectUr1":
"Location", "cookie"Cookie"} is returned, the httpc library of lua can be employed to analyze Status, Location, and Cookie data in the response header of the http protocol interface, and the Date Recue/Date Received 2022-03-04 result is returned according to the constraint protocol. By using this protocol, the redirected response of the business system is transformed to a response of status code 200 through processing by the gateway layer.
"Location", "cookie"Cookie"} is returned, the httpc library of lua can be employed to analyze Status, Location, and Cookie data in the response header of the http protocol interface, and the Date Recue/Date Received 2022-03-04 result is returned according to the constraint protocol. By using this protocol, the redirected response of the business system is transformed to a response of status code 200 through processing by the gateway layer.
[0123] As should be understood, although the various steps in the flowcharts of Figs. 2-7 are sequentially displayed as indicated by arrows, these steps are not necessarily executed in the sequences indicated by arrows. Unless otherwise explicitly noted in this paper, execution of these steps is not restricted by any sequence, as these steps can also be executed in other sequences (than those indicated in the drawings). Moreover, at least partial steps in Figs. 2-7 may include plural sub-steps or multi-phases, these sub-steps or phases are not necessarily completed at the same timing, but can be executed at different timings, and these sub-steps or phases are also not necessarily sequentially performed, but can be performed in turns or alternately with other steps or with at least some of sub-steps or phases of other steps.
[0124] In one embodiment, as shown in Fig. 8, there is provided a device for capturing an Hap redirecting status code, and the device comprises a status code obtaining module 802, a message constructing module 804 and a returning module 806.
[0125] The status code obtaining module 802 is employed for obtaining a first status code, wherein the first status code is a status code in a response header of a first response message, and the first response message is an Http response message returned by a business system after an Hap request has been initiated to the business system.
[0126] The message constructing module 804 is employed for constructing a second response message according to a preset message protocol format and the first status code when the first status code is a redirecting status code, wherein the first status code is carried in a message body of the second response message.
Date Recue/Date Received 2022-03-04
Date Recue/Date Received 2022-03-04
[0127] In one embodiment, the message header of the second response message carries therein a second status code, wherein the second status code is a status code supported by the receiver and different from the first status code.
[0128] The returning module 806 is employed for returning the second response message, wherein the second response is for instructing a receiver to obtain the redirecting status code according to the message protocol format.
[0129] In one embodiment, the message constructing module 804 obtains network location information in the response header of the first response message when the first status code is a redirecting status code, and constructs the second response message according to the preset message protocol format, the first status code and the network location information, wherein the message body of the second response message further carries therein the network location information.
[0130] In one embodiment, the message constructing module 804 obtains network location information in the response header of the first response message and Cookie data in the response header of the first response message when the first status code is a redirecting status code, and constructs the second response message according to the preset message protocol format, the first status code, the network location information and the Cookie data, wherein the message body of the second response message further carries therein the network location information.
[0131] In one embodiment, the aforementioned device for capturing an Http redirecting status code further comprises a message screening module for screening the received response message according to preset user agent screening rule or/and description information screening rule, and the status code obtaining module 802 takes the received response message as the first response message when the screening result of the message screening module is that the received response message satisfies the user agent screening rule or/and Date Recue/Date Received 2022-03-04 the description information screening rule, and obtains the first status code.
[0132] In one embodiment, the returning module 806 is further employed for returning the first response message when the first status code is a non-redirecting status code.
[0133] In one embodiment, the device is applied to a gateway layer, wherein the receiver is a terminal, on which an applet application is operative, wherein the applet application obtains the redirecting status code according to the message protocol format.
[0134] In one embodiment, as shown in Fig. 9, there is provided a device for capturing an Http redirecting status code, and the device comprises a communicating module 902 and a status code capturing module 904, wherein:
[0135] the communicating module 902 is employed for receiving a response message; and
[0136] the status code capturing module 904 is employed for obtaining, when it is determined that the received response message is a second response message, a redirecting status code carried in a message body of the second response message according to a preset message protocol format, wherein the redirecting status code is a first status code, and the second response message is constructed according to the message protocol format and the first status code.
[0137] In one embodiment, the message header of the second response message carries therein a second status code, wherein the second status code is a status code supported by the receiver and different from the first status code.
[0138] In one embodiment, the message header of the second response message further carries therein network location information, or the message header of the second response message further carries therein network location information and Cookie data.
[0139] Specific definitions relevant to the device for capturing an Http redirecting status code Date Recue/Date Received 2022-03-04 may be inferred from the aforementioned definitions to the method of capturing an Http redirecting status code, while no repetition is made in this context. The various modules in the aforementioned device for capturing an Http redirecting status code can be wholly or partly realized via software, hardware, and a combination of software with hardware.
The various modules can be embedded in the form of hardware in a processor in a computer equipment or independent of any computer equipment, and can also be stored in the form of software in a memory in a computer equipment, so as to facilitate the processor to invoke and perform operations corresponding to the aforementioned various modules.
The various modules can be embedded in the form of hardware in a processor in a computer equipment or independent of any computer equipment, and can also be stored in the form of software in a memory in a computer equipment, so as to facilitate the processor to invoke and perform operations corresponding to the aforementioned various modules.
[0140] In one embodiment, a computer equipment is provided, which can be a server, and its internal structure can be as shown in Fig. 10. The computer equipment comprises a processor, a memory and a network interface connected to each other via a system bus.
The processor of the computer equipment is employed to provide computing and controlling capabilities. The memory of the computer equipment includes a nonvolatile storage medium, and an internal memory. The nonvolatile storage medium stores therein an operating system, a computer program and a database. The internal memory provides environment for the running of the operating system and the computer program in the nonvolatile storage medium. The network interface of the computer equipment is employed to communicate with an external terminal via network connection. The computer program realizes a method of capturing an Http redirecting status code when it is executed by a processor.
The processor of the computer equipment is employed to provide computing and controlling capabilities. The memory of the computer equipment includes a nonvolatile storage medium, and an internal memory. The nonvolatile storage medium stores therein an operating system, a computer program and a database. The internal memory provides environment for the running of the operating system and the computer program in the nonvolatile storage medium. The network interface of the computer equipment is employed to communicate with an external terminal via network connection. The computer program realizes a method of capturing an Http redirecting status code when it is executed by a processor.
[0141] In one embodiment, there is provided a computer equipment that can be a gateway, and its internal structure can be as shown in Fig. 11. The computer equipment can comprise one or more of the following components: a processor, a memory and a transceiver, wherein the processor, the memory and the transceiver can be connected to each other via a data bus.
Date Recue/Date Received 2022-03-04
Date Recue/Date Received 2022-03-04
[0142] The processor can include one or more processing core(s). The processor uses various interfaces and lines to connect various parts within the entire gateway, executes various functions accessed to the gateway and processes data by operating or executing instructions, programs, code sets or instruction sets stored in the memory and by invoking data stored in the memory. Optionally, the processor can be embodied in the form of at least one hardware selected from digital signal processing (DSP), field-programmable gate array (FPGA) and Programmable LogicArray (PLA). The processor can integrate a central processing unit (CPU), modem, etc. or any combination thereof, wherein the CPU
mainly processes the operating system and application programs, and the modem is employed to process wireless communication. As is understandable, the modem can also not be integrated into the processor, but separately realized via a single chip.
mainly processes the operating system and application programs, and the modem is employed to process wireless communication. As is understandable, the modem can also not be integrated into the processor, but separately realized via a single chip.
[0143] In one embodiment, there is provided a computer equipment that comprises a memory, a processor and a computer program stored on the memory and operable on the processor, and the following steps are realized when the processor executes the computer program:
obtaining a first status code, wherein the first status code is a status code in a response header of a first response message, and the first response message is an Http response message returned by a business system after an Http request has been initiated to the business system; constructing a second response message according to a preset message protocol format and the first status code when the first status code is a redirecting status code, wherein the first status code is carried in a message body of the second response message; and returning the second response message, wherein the second response is for instructing a receiver to obtain the redirecting status code according to the message protocol format.
obtaining a first status code, wherein the first status code is a status code in a response header of a first response message, and the first response message is an Http response message returned by a business system after an Http request has been initiated to the business system; constructing a second response message according to a preset message protocol format and the first status code when the first status code is a redirecting status code, wherein the first status code is carried in a message body of the second response message; and returning the second response message, wherein the second response is for instructing a receiver to obtain the redirecting status code according to the message protocol format.
[0144] In one embodiment, the message header of the second response message carries therein a second status code, wherein the second status code is a status code supported by the receiver and different from the first status code.
Date Recue/Date Received 2022-03-04
Date Recue/Date Received 2022-03-04
[0145] In one embodiment, when the processor executes the computer program to realize the step of constructing a second response message according to a preset message protocol format and the first status code when the first status code is a redirecting status code, the following steps are specifically realized: obtaining network location information in the response header of the first response message when the first status code is a redirecting status code; and constructing the second response message according to the preset message protocol format, the first status code and the network location information, wherein the message body of the second response message further carries therein the network location information.
[0146] In one embodiment, when the processor executes the computer program to realize the step of constructing a second response message according to a preset message protocol format and the first status code when the first status code is a redirecting status code, the following steps are specifically realized: obtaining network location information in the response header of the first response message and Cookie data in the response header of the first response message when the first status code is a redirecting status code; and constructing the second response message according to the preset message protocol format, the first status code, the network location information and the Cookie data, wherein the message body of the second response message further carries therein the network location information and the Cookie data.
[0147] In one embodiment, when the processor executes the computer program, the following steps are further realized:
[0148] screening the received response message according to preset user agent screening rule or/and description information screening rule; and taking the received response message as the first response message when the received response message satisfies the user agent screening rule or/and the description information screening rule, and entering the step of obtaining a first status code.
Date Recue/Date Received 2022-03-04
Date Recue/Date Received 2022-03-04
[0149] In one embodiment, when the processor executes the computer program, the following step is further realized:
[0150] returning the first response message when the first status code is a non-redirecting status code.
[0151] In one embodiment, the receiver is a terminal, on which an applet application is operative, wherein the applet application obtains the redirecting status code according to the message protocol format.
[0152] In one embodiment, a computer equipment is provided, which can be a terminal, and its internal structure can be as shown in Fig. 12. The computer equipment comprises a processor, a memory, a network interface, a display screen and an input means connected to each other via a system bus. The processor of the computer equipment is employed to provide computing and controlling capabilities. The memory of the computer equipment includes a nonvolatile storage medium and an internal memory. The nonvolatile storage medium stores therein an operating system and a computer program. The internal memory provides environment for the running of the operating system and the computer program in the nonvolatile storage medium. The network interface of the computer equipment is employed to communicate with an external terminal via network connection. The computer program realizes a method of capturing an Http redirecting status code when it is executed by a processor. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, while the input means of the computer equipment can be a touch layer covering on the display screen, can also be a press button, a track ball or a touch control board disposed on the housing of the computer equipment, and can further be an externally connected keyboard, touch control board or mouse, etc.
[0153] In one embodiment, there is provided a computer equipment that comprises a memory, a processor and a computer program stored on the memory and operable on the processor, Date Recue/Date Received 2022-03-04 and the following steps are realized when the processor executes the computer program.
[0154] As understandable to persons skilled in the art, the structures illustrated in Figs. 10 -12 are merely block diagrams of partial structure relevant to the solution of the present application, and do not constitute any restriction to the computer equipment on which the solution of the present application is applied, as the specific computer equipment may comprise component parts that are more than or less than those illustrated in the figures, or may combine certain component parts, or may have different layout of component parts.
[0155] In one embodiment, there is provided a computer-readable storage medium storing thereon a computer program, and the following steps are realized when the computer program is executed by a processor:
[0156] obtaining a first status code, wherein the first status code is a status code in a response header of a first response message, and the first response message is an Http response message returned by a business system after an Http request has been initiated to the business system; constructing a second response message according to a preset message protocol format and the first status code when the first status code is a redirecting status code, wherein the first status code is carried in a message body of the second response message; and returning the second response message, wherein the second response is for instructing a receiver to obtain the redirecting status code according to the message protocol format.
[0157] In one embodiment, the message header of the second response message carries therein a second status code, wherein the second status code is a status code supported by the receiver and different from the first status code.
[0158] In one embodiment, when the computer program is executed by a processor to realize the step of constructing a second response message according to a preset message protocol Date Recue/Date Received 2022-03-04 format and the first status code when the first status code is a redirecting status code, the following steps are specifically realized: obtaining network location information in the response header of the first response message when the first status code is a redirecting status code; and constructing the second response message according to the preset message protocol format, the first status code and the network location information, wherein the message body of the second response message further carries therein the network location information.
[0159] In one embodiment, when the computer program is executed by a processor to realize the step of constructing a second response message according to a preset message protocol format and the first status code when the first status code is a redirecting status code, the following steps are specifically realized: obtaining network location information in the response header of the first response message and Cookie data in the response header of the first response message when the first status code is a redirecting status code; and constructing the second response message according to the preset message protocol format, the first status code, the network location information and the Cookie data, wherein the message body of the second response message further carries therein the network location information and the Cookie data.
[0160] In one embodiment, when the computer program is executed by a processor, the following steps are further realized: screening the received response message according to preset user agent screening rule or/and description information screening rule; and taking the received response message as the first response message when the received response message satisfies the user agent screening rule or/and the description information screening rule, and entering the step of obtaining a first status code.
[0161] In one embodiment, when the computer program is executed by a processor, the following step is further realized: returning the first response message when the first status code is a non-redirecting status code.
Date Recue/Date Received 2022-03-04
Date Recue/Date Received 2022-03-04
[0162] In one embodiment, the method is applied to a gateway, wherein the receiver is a terminal, on which an applet application is operative, wherein the applet application obtains the redirecting status code according to the message protocol format.
[0163] In one embodiment, there is provided a computer-readable storage medium storing thereon a computer program, and the following steps are realized when the computer program is executed by a processor:
[0164] receiving a response message; and
[0165] obtaining, when it is determined that the received response message is a second response message, a redirecting status code carried in a message body of the second response message according to a preset message protocol format, wherein the redirecting status code is a first status code, and the second response message is constructed according to the message protocol format and the first status code.
[0166] As comprehensible to persons ordinarily skilled in the art, the entire or partial flows in the methods according to the aforementioned embodiments can be completed via a computer program instructing relevant hardware, the computer program can be stored in a nonvolatile computer-readable storage medium, and the computer program can include the flows as embodied in the aforementioned various methods when executed. Any reference to the memory, storage, database or other media used in the various embodiments provided by the present application can all include nonvolatile and/or volatile memory/memories. The nonvolatile memory can include a read-only memory (ROM), a programmable ROM (PROM), an electrically programmable ROM (EPROM), an electrically erasable and programmable ROM (EEPROM) or a flash memory. The volatile memory can include a random access memory (RAM) or an external cache memory. To serve as explanation rather than restriction, the RAM is obtainable in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM
(SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), Date Recue/Date Received 2022-03-04 synchronous link (Synchlink) DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct Rambus dynamic RAM (DRDRAM), and Rambus dynamic RAM (RDRAM), etc.
(SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), Date Recue/Date Received 2022-03-04 synchronous link (Synchlink) DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct Rambus dynamic RAM (DRDRAM), and Rambus dynamic RAM (RDRAM), etc.
[0167] Technical features of the aforementioned embodiments are randomly combinable, while all possible combinations of the technical features in the aforementioned embodiments are not exhausted for the sake of brevity, but all these should be considered to fall within the scope recorded in the Description as long as such combinations of the technical features are not mutually contradictory.
[0168] The foregoing embodiments are merely directed to several modes of execution of the present application, and their descriptions are relatively specific and detailed, but they should not be hence misunderstood as restrictions to the inventive patent scope. As should be pointed out, persons with ordinary skill in the art may further make various modifications and improvements without departing from the conception of the present application, and all these should pertain to the protection scope of the present application.
Accordingly, the patent protection scope of the present application shall be based on the attached Claims.
Date Recue/Date Received 2022-03-04
Accordingly, the patent protection scope of the present application shall be based on the attached Claims.
Date Recue/Date Received 2022-03-04
Claims (10)
1. A method of capturing an Http redirecting status code, characterized in comprising:
obtaining a first status code, wherein the first status code is a status code in a response header of a first response message, and the first response message is an Http response message returned by a business system after an Http request has been initiated to the business system;
constructing a second response message according to a preset message protocol format and the first status code when the first status code is a redirecting status code, wherein the first status code is carried in a message body of the second response message; and returning the second response message, wherein the second response is for instructing a receiver to obtain the redirecting status code according to the message protocol format.
obtaining a first status code, wherein the first status code is a status code in a response header of a first response message, and the first response message is an Http response message returned by a business system after an Http request has been initiated to the business system;
constructing a second response message according to a preset message protocol format and the first status code when the first status code is a redirecting status code, wherein the first status code is carried in a message body of the second response message; and returning the second response message, wherein the second response is for instructing a receiver to obtain the redirecting status code according to the message protocol format.
2. The method according to Claim 1, characterized in that the message header of the second response message carries therein a second status code, wherein the second status code is a status code supported by the receiver and different from the first status code.
3. The method according to Claim 1 or 2, characterized in that the step of constructing a second response message according to a preset message protocol format and the first status code when the first status code is a redirecting status code includes:
obtaining network location information in the response header of the first response message when the first status code is a redirecting status code; preferably, also obtaining Cookie data in the response header of the first response message; and constructing the second response message according to the preset message protocol format, the first status code and the network location information, wherein the message body of the second response message further carries therein the network location information;
preferably, constructing the second response message also according to the Cookie data, wherein the message body of the second response message further carries therein the Cookie data.
obtaining network location information in the response header of the first response message when the first status code is a redirecting status code; preferably, also obtaining Cookie data in the response header of the first response message; and constructing the second response message according to the preset message protocol format, the first status code and the network location information, wherein the message body of the second response message further carries therein the network location information;
preferably, constructing the second response message also according to the Cookie data, wherein the message body of the second response message further carries therein the Cookie data.
4. The method according to Claim 3, characterized in further comprising:
screening the received response message according to preset user agent screening rule or/and description information screening rule; and taking the received response message as the first response message when the received response message satisfies the user agent screening rule or/and the description information screening rule, and entering the step of obtaining a first status code.
screening the received response message according to preset user agent screening rule or/and description information screening rule; and taking the received response message as the first response message when the received response message satisfies the user agent screening rule or/and the description information screening rule, and entering the step of obtaining a first status code.
5. The method according to Claim 3, characterized in further comprising:
returning the first response message when the first status code is a non-redirecting status code.
returning the first response message when the first status code is a non-redirecting status code.
6. The method according to Claim 1 or 2, characterized in that the method is applied to a gateway, wherein the receiver is a terminal, on which an applet application is operative, wherein the applet application obtains the redirecting status code according to the message protocol format.
7. A method of capturing an Http redirecting status code, characterized in comprising:
receiving a response message; and obtaining, when it is determined that the received response message is a second response message, a redirecting status code carried in a message body of the second response message according to a preset message protocol format, wherein the redirecting status code is a first status code, and the second response message is constructed according to the message protocol format and the first status code.
receiving a response message; and obtaining, when it is determined that the received response message is a second response message, a redirecting status code carried in a message body of the second response message according to a preset message protocol format, wherein the redirecting status code is a first status code, and the second response message is constructed according to the message protocol format and the first status code.
8. A device for capturing an Http redirecting status code, characterized in comprising:
a status code obtaining module, for obtaining a first status code, wherein the first status code is a status code in a response header of a first response message, and the first response message is an Http response message returned by a business system after an Http request has been initiated to the business system;
a message constructing module, for constructing a second response message according to a preset message protocol format and the first status code when the first status code is a redirecting status code, wherein the first status code is carried in a message body of the second response message;
and a returning module, for returning the second response message, wherein the second response is for instructing a receiver to obtain the redirecting status code according to the message protocol format.
a status code obtaining module, for obtaining a first status code, wherein the first status code is a status code in a response header of a first response message, and the first response message is an Http response message returned by a business system after an Http request has been initiated to the business system;
a message constructing module, for constructing a second response message according to a preset message protocol format and the first status code when the first status code is a redirecting status code, wherein the first status code is carried in a message body of the second response message;
and a returning module, for returning the second response message, wherein the second response is for instructing a receiver to obtain the redirecting status code according to the message protocol format.
9. A
computer equipment, comprising a memory, a processor and a computer program stored on the memory and operable on the processor, characterized in that the method steps according to anyone of Claims 1 to 7 are realized when the processor executes the computer program.
computer equipment, comprising a memory, a processor and a computer program stored on the memory and operable on the processor, characterized in that the method steps according to anyone of Claims 1 to 7 are realized when the processor executes the computer program.
10. A computer-readable storage medium, storing a computer program thereon, characterized in that the method steps according to anyone of Claims 1 to 7 are realized when the computer program is executed by a processor.
Applications Claiming Priority (3)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910831868.9A CN110661787A (en) | 2019-09-04 | 2019-09-04 | Method and device for capturing Http redirection state code and computer equipment |
CN201910831868.9 | 2019-09-04 | ||
PCT/CN2020/096996 WO2021042815A1 (en) | 2019-09-04 | 2020-06-19 | Http redirect status code capture method and apparatus, and computer device |
Publications (2)
Publication Number | Publication Date |
---|---|
CA3153431A1 true CA3153431A1 (en) | 2021-03-11 |
CA3153431C CA3153431C (en) | 2024-06-25 |
Family
ID=69037923
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CA3153431A Active CA3153431C (en) | 2019-09-04 | 2020-06-19 | Http redirect status code capture method and apparatus, and computer device |
Country Status (3)
Country | Link |
---|---|
CN (1) | CN110661787A (en) |
CA (1) | CA3153431C (en) |
WO (1) | WO2021042815A1 (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TWI755005B (en) * | 2020-07-29 | 2022-02-11 | 鴻海精密工業股份有限公司 | Test method based on improved rest protocol, client, server and medium |
CN111858381B (en) * | 2020-07-31 | 2023-05-16 | 抖音视界有限公司 | Application fault tolerance capability test method, electronic device and medium |
CN113992755B (en) * | 2021-10-27 | 2024-06-28 | 中国电信股份有限公司 | Request processing method, system, equipment and storage medium based on micro-service gateway |
CN114172877B (en) * | 2021-11-11 | 2024-01-26 | 欧冶云商股份有限公司 | Middleware data transmission method, device, equipment and storage medium based on HTTP protocol |
Family Cites Families (21)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7136930B1 (en) * | 1999-11-05 | 2006-11-14 | Nokia Corporation | System and method for effective use of air link between mobile stations and gateway servers |
FI20001877A (en) * | 2000-08-25 | 2002-02-26 | Nokia Networks Oy | Handover in a wireless telecommunication system |
JP4285655B2 (en) * | 2005-07-19 | 2009-06-24 | インターナショナル・ビジネス・マシーンズ・コーポレーション | Method, apparatus, and program for providing Web service |
US7995559B2 (en) * | 2006-02-27 | 2011-08-09 | Cisco Technology, Inc. | System and method for interworking communication protocols to provide supplementary services |
CN101420729A (en) * | 2007-10-26 | 2009-04-29 | 华为技术有限公司 | Method, system and apparatus for implementing redirection |
CN101764767A (en) * | 2008-12-23 | 2010-06-30 | 华为技术有限公司 | Network interconnection method, gateway facility and system |
CN101854375A (en) * | 2009-03-31 | 2010-10-06 | 华为软件技术有限公司 | Redirecting method and device |
US9264435B2 (en) * | 2011-02-15 | 2016-02-16 | Boingo Wireless, Inc. | Apparatus and methods for access solutions to wireless and wired networks |
CN102291437A (en) * | 2011-07-27 | 2011-12-21 | 武汉天喻信息产业股份有限公司 | System and method for realizing application of cross-platform internet |
CN103200146B (en) * | 2012-01-04 | 2016-05-25 | 中国移动通信集团安徽有限公司 | The method of data synchronization of terminal and server and device |
CN102638454B (en) * | 2012-03-14 | 2014-05-21 | 武汉理工大学 | Plug-in type SSO (single signon) integration method oriented to HTTP (hypertext transfer protocol) identity authentication protocol |
CN103580937B (en) * | 2012-07-24 | 2016-11-23 | 阿里巴巴集团控股有限公司 | A kind of Web services the method and system thereof and service broker system simulated |
CN104168316B (en) * | 2014-08-11 | 2019-01-11 | 北京星网锐捷网络技术有限公司 | A kind of Webpage access control method, gateway |
CN105791450A (en) * | 2014-12-19 | 2016-07-20 | 中兴通讯股份有限公司 | Redirecting method, device and system for domain name system DNS |
CN105939313B (en) * | 2015-09-01 | 2019-03-15 | 杭州迪普科技股份有限公司 | Status code reorientation method and device |
CN105227667A (en) * | 2015-10-14 | 2016-01-06 | 深圳市金证科技股份有限公司 | Message forwarding method and platform |
CN105721479B (en) * | 2016-03-02 | 2019-01-04 | 北京网康科技有限公司 | A kind of network address filter method and device |
CN106101239B (en) * | 2016-06-21 | 2018-12-25 | 杭州迪普科技股份有限公司 | The rewrite method and device of HTTP redirection message |
CN106878337A (en) * | 2017-03-29 | 2017-06-20 | 华南理工大学 | A kind of Web authentication method and system for realizing access network source address validation |
CN108965223A (en) * | 2017-12-12 | 2018-12-07 | 北京视联动力国际信息技术有限公司 | It is a kind of based on view networking web page processing method, proxy server and view networked terminals |
CN110022289B (en) * | 2018-01-10 | 2022-07-05 | 北龙中网(北京)科技有限责任公司 | Data transmission method, device and system |
-
2019
- 2019-09-04 CN CN201910831868.9A patent/CN110661787A/en active Pending
-
2020
- 2020-06-19 WO PCT/CN2020/096996 patent/WO2021042815A1/en active Application Filing
- 2020-06-19 CA CA3153431A patent/CA3153431C/en active Active
Also Published As
Publication number | Publication date |
---|---|
WO2021042815A1 (en) | 2021-03-11 |
CN110661787A (en) | 2020-01-07 |
CA3153431C (en) | 2024-06-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CA3153431C (en) | Http redirect status code capture method and apparatus, and computer device | |
US9264435B2 (en) | Apparatus and methods for access solutions to wireless and wired networks | |
CN110990205B (en) | Interface call testing method, device and computer readable storage medium | |
EP2659367B1 (en) | Online privacy management | |
CN111177617A (en) | Web direct operation and maintenance method and device based on operation and maintenance management system and electronic equipment | |
US20140006924A1 (en) | Methods and Systems for Secure In-Network Insertion of Web Content and Web Services | |
CN110888613B (en) | Printing method, printing device, printing system and electronic equipment | |
CN102917074A (en) | Server-side browser realization method and server | |
JP6666441B2 (en) | IP address obtaining method and apparatus | |
CN104038510A (en) | IOS system transparent agent realization method and system | |
CN105635073A (en) | Access control method and device and network access equipment | |
CN107770189A (en) | Reverse proxy method, system, proxy server and storage medium | |
US20160234320A1 (en) | System, device, and method for accessing cross-platform service | |
EP2973192B1 (en) | Online privacy management | |
US8756290B2 (en) | System, method and computer program product for reconstructing data received by a computer in a manner that is independent of the computer | |
US20140157104A1 (en) | Dynamic sharing and updating of a web page | |
US20080162687A1 (en) | Data acquisition system and method | |
CN114915565B (en) | Network debugging method and system | |
US9830209B2 (en) | Web based user interface driven prophylactic cross-domain communication architecture | |
US11615017B2 (en) | Discovery and aggregation of multivariate test experiments | |
US11210360B2 (en) | Edge-caching optimization of personalized webpages | |
CA3116035A1 (en) | Content server for mapping a plurality of third-party entities and their interdependencies | |
WO2014084771A1 (en) | Dynamic sharing and updating of a web page | |
CN104767667A (en) | Method for sharing WEB page by multiple screens, terminal equipment and web server | |
US11562092B1 (en) | Loading and managing third-party tools on a website |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
EEER | Examination request |
Effective date: 20220916 |
|
EEER | Examination request |
Effective date: 20220916 |
|
EEER | Examination request |
Effective date: 20220916 |
|
EEER | Examination request |
Effective date: 20220916 |
|
EEER | Examination request |
Effective date: 20220916 |
|
EEER | Examination request |
Effective date: 20220916 |
|
EEER | Examination request |
Effective date: 20220916 |
|
EEER | Examination request |
Effective date: 20220916 |
|
EEER | Examination request |
Effective date: 20220916 |