A method and terminal for detecting correctness of resource files
A resource file and correctness technology, which is applied in the direction of network data retrieval, other database retrieval, website content management, etc., can solve problems such as low efficiency, achieve the effect of improving efficiency, ensuring user experience and functional integrity
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0070] Please refer to figure 1 , a method for detecting the correctness of resources, including the steps of:
[0071] S1. Obtain a first resource with a preset attribute on the current page, where the preset attribute is used to indicate the integrity of the first resource;
[0072] Wherein, in the browser of the client, the first resource corresponds to the second resource of the server, and the preset attribute is specifically a data-integrity attribute;
[0073] The first resource is the style and script file of the current page. Before the S1, the server scans the html file in the local project directory, and parses out the second resource corresponding to the first resource through a regular expression. The second The resource includes the style and script file of the parsed html file, the resource content of the second resource is read through the relative path of the second resource, and the third attribute value of the second resource is calculated through a preset ...
Embodiment 2
[0092] Please refer to figure 1 and image 3 , the difference between this embodiment and embodiment one is; also includes:
[0093] If the callback fails, and the first resource may be tampered with, execute S4;
[0094] S4. Re-initiate a second remote call request with the same address, and the second remote call request has no integrity attribute;
[0095] Obtaining resource information corresponding to the address through the second remote call request, and storing the resource information into a library;
[0096] Wherein, the corresponding resource information is specifically the resource information corresponding to the first resource, including the resource size and address information of the corresponding resource, and also includes information such as the user ip corresponding to the first resource;
[0097] Wherein, storing the resource information into the database includes:
[0098] Send information such as the resource size and address information of the resou...
Embodiment 3
[0101]Apply the technical solution of this application to a specific application scenario. For example, during the double 11 event, when a user uses a business product of the product side, a pop-up advertisement appears for Alipay to receive a red envelope. The user uses the technical solution of this application to obtain the current page The first resource with the preset data-integrity attribute, the first resource is the style and script file of the current page, create a sandbox isolation, and obtain the address and data-integrity of the first resource in sequence in the sandbox An attribute value of the integrity attribute, according to the address and the attribute value, sending and acquiring the first resource to construct a first remote call request, setting the value of the integrity attribute of the first remote call request as the attribute value of the data-integrity attribute, Monitor the callback result of the first remote call. If the callback is successful, it...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 


